Bruno Haible <br...@clisp.org> writes:

> Simon Josefsson wrote:
>> It was configured with:
>> 
>> CC=c89 CFLAGS="-D_POSIX_SOURCE -I/usr/local/include" ...
>
> Bingo. On many platforms, the _POSIX_SOURCE macro has the effect of
> *hiding* declarations, not of enabling them:
>
> $ uname -srv 
> IRIX64 6.5 10060437
> $ cat foo.c
> #include <string.h>
> $ cc -E foo.c | grep strdup
> extern char *strdup(const char *);
> $ c89 -E foo.c | grep strdup
> extern char *strdup(const char *);
> $ c89 -D_POSIX_SOURCE -E foo.c | grep strdup
>
> Autoconf's and Gnulib's 'extensions' macro does a good job at enabling
> most useful declarations, but it cannot prevail against a user who specifies
> _POSIX_SOURCE.

Indeed.  I have reverted the strdup and select patch, and I'll treat
this as a user error.  Btw, is there any best practice on how to
document reverted patches in ChangeLog for gnulib, if at all?

/Simon

Reply via email to