Skip to content

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

Description

@CodingMarkus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions