new FreeBSD port maintainer
Rich Felker
dalias at aerifal.cx
Sun Sep 11 14:36:47 UTC 2011
On Sun, Sep 11, 2011 at 04:29:30AM +0200, Matthias Andree wrote:
> >> * POSIX conforming applications using dirname() need not be changed
> >> for use with FreeBSD's dirname() implementation.
> >
> > The following application is a strictly conforming POSIX application:
> >
> > #define _POSIX_C_SOURCE 200809L
> > #include <libgen.h>
> > char *dirname(char *);
>
> The application is nonconforming because the permission to declare the
> functions yourself applies if you do NOT include the header.
>
> Mind statement 2 from the same section that you cited, which begins:
>
> "Any function declared in a header may also be implemented as a macro
> defined in the header, so a function should not be declared explicitly
> if its header is included. (...)".
The standard also explictly allows #undef to avoid using macros, or
you could change my example to use:
char *(dirname)(char *);
And either way, now it is conforming.
Rich
More information about the busybox
mailing list