Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2014-08-01 19:44:51 +0400
committerEric Blake <eblake@redhat.com>2014-08-01 19:44:51 +0400
commitada456dcfed23e2f3f1d92574993aef15e134418 (patch)
tree957d292ef7b5de776e9c88a95e14b310c0921aed /newlib/libc/sys/linux/dl
parent02206cd3e4c414635e5094670d440069959c4198 (diff)
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.
Diffstat (limited to 'newlib/libc/sys/linux/dl')
-rw-r--r--newlib/libc/sys/linux/dl/atomicity.h6
-rw-r--r--newlib/libc/sys/linux/dl/dynamic-link.h4
-rw-r--r--newlib/libc/sys/linux/dl/ldsodefs.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/newlib/libc/sys/linux/dl/atomicity.h b/newlib/libc/sys/linux/dl/atomicity.h
index 3dbd00689..2ff7e5270 100644
--- a/newlib/libc/sys/linux/dl/atomicity.h
+++ b/newlib/libc/sys/linux/dl/atomicity.h
@@ -23,7 +23,7 @@
static inline uint32_t
-__attribute__ ((unused))
+__attribute__ ((__unused__))
exchange_and_add (volatile uint32_t *mem, uint32_t val)
{
register uint32_t result;
@@ -33,7 +33,7 @@ exchange_and_add (volatile uint32_t *mem, uint32_t val)
}
static inline void
-__attribute__ ((unused))
+__attribute__ ((__unused__))
atomic_add (volatile uint32_t *mem, int val)
{
__asm__ __volatile__ ("lock; addl %1,%0"
@@ -41,7 +41,7 @@ atomic_add (volatile uint32_t *mem, int val)
}
static inline char
-__attribute__ ((unused))
+__attribute__ ((__unused__))
compare_and_swap (volatile long int *p, long int oldval, long int newval)
{
char ret;
diff --git a/newlib/libc/sys/linux/dl/dynamic-link.h b/newlib/libc/sys/linux/dl/dynamic-link.h
index c1709f7c6..4445bca48 100644
--- a/newlib/libc/sys/linux/dl/dynamic-link.h
+++ b/newlib/libc/sys/linux/dl/dynamic-link.h
@@ -31,12 +31,12 @@
/* Global read-only variable defined in rtld.c which is nonzero if we
shall give more warning messages. */
-extern int _dl_verbose __attribute__ ((unused));
+extern int _dl_verbose __attribute__ ((__unused__));
/* Read the dynamic section at DYN and fill in INFO with indices DT_*. */
-static void __attribute__ ((unused))
+static void __attribute__ ((__unused__))
elf_get_dynamic_info (struct link_map *l)
{
ElfW(Dyn) *dyn = l->l_ld;
diff --git a/newlib/libc/sys/linux/dl/ldsodefs.h b/newlib/libc/sys/linux/dl/ldsodefs.h
index e6f57ddcf..8cf487ad9 100644
--- a/newlib/libc/sys/linux/dl/ldsodefs.h
+++ b/newlib/libc/sys/linux/dl/ldsodefs.h
@@ -162,7 +162,7 @@ struct libname_list
/* Test whether given NAME matches any of the names of the given object. */
static __inline int
-__attribute__ ((unused))
+__attribute__ ((__unused__))
_dl_name_match_p (const char *__name, struct link_map *__map)
{
int __found = strcmp (__name, __map->l_name) == 0;