]> sourceware.org Git - newlib-cygwin.git/commit
headers: properly decorate attributes
authorEric Blake <eblake@redhat.com>
Fri, 1 Aug 2014 15:44:51 +0000 (15:44 +0000)
committerEric Blake <eblake@redhat.com>
Fri, 1 Aug 2014 15:44:51 +0000 (15:44 +0000)
commitada456dcfed23e2f3f1d92574993aef15e134418
tree957d292ef7b5de776e9c88a95e14b310c0921aed
parent02206cd3e4c414635e5094670d440069959c4198
headers: properly decorate attributes

Found by:
find -name '*.h' |xargs grep -i 'attribute.*(([a-z]'

For an example of the type of bugs this causes, try compiling this valid
C11 program (it's valid because 'noreturn' is reserved for use in the
user namespace unless you include <stdnoreturn.h>):

$ cat foo.c
#define noreturn __attribute__((noreturn))
#include <stdlib.h>
$ gcc -c -o foo.o -Wall foo.c
In file included from /usr/include/stdlib.h:11:0,
                 from foo.c:2:
foo.c:1:18: error: expected ')' before '__attribute__'
 #define noreturn __attribute__((noreturn))
                  ^
/usr/include/stdlib.h:66:28: error: expected ',' or ';' before ')' token
 _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
                            ^

* libc/machine/spu/spu_timer_internal.h: Decorate attribute names
with __, for namespace safety.
* libc/machine/xscale/machine/profile.h: Likewise.
* libc/include/stdlib.h: Likewise.
* libc/include/_ansi.h: Likewise.
* libc/include/sys/unistd.h: Likewise.
* libc/sys/linux/linuxthreads/libc-symbols.h: Likewise.
* libc/sys/linux/linuxthreads/internals.h: Likewise.
* libc/sys/linux/machine/i386/weakalias.h: Likewise.
* libc/sys/linux/machine/i386/dl-procinfo.h: Likewise.
* libc/sys/linux/machine/i386/dl-machine.h: Likewise.
* libc/sys/linux/libc-symbols.h: Likewise.
* libc/sys/linux/iconv/gconv_charset.h: Likewise.
* libc/sys/linux/include/resolv.h: Likewise.
* libc/sys/linux/sys/unistd.h: Likewise.
* libc/sys/linux/dl/atomicity.h: Likewise.
* libc/sys/linux/dl/dynamic-link.h: Likewise.
* libc/sys/linux/dl/ldsodefs.h: Likewise.
18 files changed:
newlib/ChangeLog
newlib/libc/include/_ansi.h
newlib/libc/include/stdlib.h
newlib/libc/include/sys/unistd.h
newlib/libc/machine/spu/spu_timer_internal.h
newlib/libc/machine/xscale/machine/profile.h
newlib/libc/sys/linux/dl/atomicity.h
newlib/libc/sys/linux/dl/dynamic-link.h
newlib/libc/sys/linux/dl/ldsodefs.h
newlib/libc/sys/linux/iconv/gconv_charset.h
newlib/libc/sys/linux/include/resolv.h
newlib/libc/sys/linux/libc-symbols.h
newlib/libc/sys/linux/linuxthreads/internals.h
newlib/libc/sys/linux/linuxthreads/libc-symbols.h
newlib/libc/sys/linux/machine/i386/dl-machine.h
newlib/libc/sys/linux/machine/i386/dl-procinfo.h
newlib/libc/sys/linux/machine/i386/weakalias.h
newlib/libc/sys/linux/sys/unistd.h
This page took 0.03176 seconds and 5 git commands to generate.