_GNU_SOURCE placement

Baurjan Ismagulov ibr@ata.cs.hun.edu.tr
Mon Nov 25 08:14:00 GMT 2002


Hello, Eljay!

On Mon, Nov 25, 2002 at 09:39:27AM -0600, Eljay Love-Jensen wrote:
> I suspect that <locale.h> somehow includes <signal.h>.
> Most header files have sentinels that only allow them to be included once.
> So by the time you define _GNU_SOURCE and include signal.h, it's too late 
> and things have already gone awry.

Locale doesn't include signal. "cpp signal2.c |grep '^#'" (some lines
skipped):
# 1 "signal2.c"
# 1 "/usr/include/locale.h" 1 3
# 1 "/usr/include/features.h" 1 3
# 1 "/usr/include/sys/cdefs.h" 1 3
# 291 "/usr/include/features.h" 2 3
# 1 "/usr/include/gnu/stubs.h" 1 3
# 320 "/usr/include/features.h" 2 3
# 26 "/usr/include/locale.h" 2 3
# 1 "/usr/lib/gcc-lib/i386-linux/2.95.4/include/stddef.h" 1 3
# 29 "/usr/include/locale.h" 2 3
# 1 "/usr/include/bits/locale.h" 1 3
# 30 "/usr/include/locale.h" 2 3
# 1 "signal2.c" 2
# 1 "/usr/include/signal.h" 1 3
...

Can you reproduce the compilation failure on your system?

With kind regards,
Baurjan.



More information about the Gcc-help mailing list