Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build on macOS as unistd.h is not included #22

Open
CodingMarkus opened this issue Jul 17, 2021 · 1 comment
Open

Does not build on macOS as unistd.h is not included #22

CodingMarkus opened this issue Jul 17, 2021 · 1 comment

Comments

@CodingMarkus
Copy link

Should fail the same way on many other POSIX systems as unlink and symlink are documented to be declared in unistd.h which isn't ever included.

troff_generator.c:225:13: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            unlink( buf );
            ^
troff_generator.c:226:13: error: implicit declaration of function 'symlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            symlink( basename( manpage ), buf );
            ^

See POSIX reference to confirm that those functions are supposed to be declared by unistd.h

Also see man page:

SYNOPSIS
     #include <unistd.h>

     int
     unlink(const char *path);

Source :man 2 unlink

Note that sys/unistd.h is no official header, neither by C nor by POSIX standard, you should never be required to include that one. Same holds true for sys/param.h. These headers are automatically included for you if you included the correct standard headers.

@remkos
Copy link

remkos commented Sep 1, 2021

Compiling on macOS worked for me by replacing <sys/unistd.h> by <unistd.h>

lutzmad added a commit to lutzmad/ROBODoc that referenced this issue Jun 3, 2023
Use the "unistd.h" instead of "sys/unistd.h". This fit to the other files where the header is used.
On the other hand "sys/unistd.h" is sometimes not available, see issue gumpu#22 and gumpu#25 for additional information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants