error.h redefining __attribute__() when __STRICT_ANSI__ is defined (std=c99)

Mike Frysinger vapier@gentoo.org
Sat Apr 8 00:02:00 GMT 2006


we hit a neat little error with some code when including error.h and 
using -std=c99 ... the question is whether this is a feature :)

take for example the attached code ... when built with -std=c99, 
__STRICT_ANSI__ is defined by gcc which causes error.h to macro away the gcc  
__attribute__ extension since gcc doesnt consider __attribute__ to ever be 
defined

perhaps a better idea would be to use __error_attribute__ inside of the header 
so that it doesnt pollute the namespace of the code that includes it ... 
patch attached
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error-attribute-test.c
Type: text/x-csrc
Size: 184 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20060408/be07dc4d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-error-header-updates.patch
Type: text/x-diff
Size: 2201 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20060408/be07dc4d/attachment-0001.bin>


More information about the Libc-alpha mailing list