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
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to