Am 11.09.2011 16:36, schrieb Rich Felker: > 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.
Either way it avoids the macro expansion, but it still isn't conforming. You may only declare standard functions in your application IF YOU DO NOT USE the associated header. Re-read statement 4. Conforming applications do not produce compilation errors around dirname() on FreeBSD. Standards discussion aside, and what matters practically: I am now aware that my change to the FreeBSD port's build procedure to globally add -include libgen.h to $CPPFLAGS (by means of the compiler default command line) may be failure-inducing, because that is what turns the conforming .c file into one that triggers the compilation failure, when it adds an #include where there already is the conforming declaration. We currently avoid that with #ifndef __FreeBSD__, which works but isn't optimal. However, there are bugs in busybox up to at least 1.19.2 were coreutils, among others, call dirname() without declaration and without #include, on FreeBSD. That needs to be pulled straight. I'll have to review the FreeBSD-specifics and build procedure around dirname and libgen.h, and make sure busybox is consistent. That's my porter's business, but won't happen in an instant. In the end I suppose that the code will lose a few #ifdef __FreeBSD__ along the way. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
