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]

Re: A small issue with _GNU_SOURCE


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...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]