This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Feb 25 16:04, Jon TURNEY wrote: > On 24/02/2015 13:28, Corinna Vinschen wrote: > >On Feb 24 12:46, Jon TURNEY wrote: > >> * libc/include/sys/cdefs.h (_GNU_SOURCE): Move check so it has an > >> effect when _XOPEN_SOURCE is also defined. > > > >Looks good, with a single nit: > > >>+/* Deal with _GNU_SOURCE, which implies everything and the kitchen sink */ > >>+#ifdef _GNU_SOURCE > > > >Before defining _XOPEN_SOURCE this should undef _XOPEN_SOURCE to avoid > >potential compiler warnings about a redefined macro. With this change, > >please apply. > > Done. > > But even now, I'm not sure this is quite right. > > $ cat test.c > > #include <string.h> > > int main() > { > strdup("test"); > return ffsll(0); > } > > $ gcc test.c -Wall -ansi > test.c: In function âmainâ: > test.c:7:2: warning: implicit declaration of function âffsllâ > > I think this should also warn about no prototype for strdup(), because that > shouldn't be in scope due to __STRICT_ANSI__, which cdefs.h doesn't even > consider... That's how it is in Glibc, but AFAICS, not on the BSDs. For instance, OpenBSD defines this as: #ifdef _POSIX_C_SOURCE # if (_POSIX_C_SOURCE - 0 >= 200809) # define __POSIX_VISIBLE 200809 # define __ISO_C_VISIBLE 1999 [...etc...] #if defined(_ANSI_SOURCE) && !defined(__POSIX_VISIBLE) && \ !defined(__XPG_VISIBLE) # define __POSIX_VISIBLE 0 # define __XPG_VISIBLE 0 # define __ISO_C_VISIBLE 1990 #endif So __POSIX_VISIBLE and __XPG_VISIBLE override strict ANSI, isn't it? Can somebody with access to a BSD system test this, perhaps? Thanks, Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
Attachment:
pgpAgMMbZRrq0.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |