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/linuxthreads
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/linuxthreads')
-rw-r--r--newlib/libc/sys/linux/linuxthreads/internals.h6
-rw-r--r--newlib/libc/sys/linux/linuxthreads/libc-symbols.h16
2 files changed, 11 insertions, 11 deletions
diff --git a/newlib/libc/sys/linux/linuxthreads/internals.h b/newlib/libc/sys/linux/linuxthreads/internals.h
index 6da0deb43..1167bd43e 100644
--- a/newlib/libc/sys/linux/linuxthreads/internals.h
+++ b/newlib/libc/sys/linux/linuxthreads/internals.h
@@ -187,7 +187,7 @@ struct _pthread_descr_struct {
hp_timing_t p_cpuclock_offset; /* Initial CPU clock for thread. */
#endif
/* New elements must be added at the end. */
-} __attribute__ ((aligned(32))); /* We need to align the structure so that
+} __attribute__ ((__aligned__(32))); /* We need to align the structure so that
doubles are aligned properly. This is 8
bytes on MIPS and 16 bytes on MIPS64.
32 bytes might give better cache
@@ -374,9 +374,9 @@ static inline int nonexisting_handle(pthread_handle h, pthread_t id)
/* Recover thread descriptor for the current thread */
-extern pthread_descr __pthread_find_self (void) __attribute__ ((const));
+extern pthread_descr __pthread_find_self (void) __attribute__ ((__const__));
-static inline pthread_descr thread_self (void) __attribute__ ((const));
+static inline pthread_descr thread_self (void) __attribute__ ((__const__));
static inline pthread_descr thread_self (void)
{
#ifdef THREAD_SELF
diff --git a/newlib/libc/sys/linux/linuxthreads/libc-symbols.h b/newlib/libc/sys/linux/linuxthreads/libc-symbols.h
index 97b672643..3f56cc259 100644
--- a/newlib/libc/sys/linux/linuxthreads/libc-symbols.h
+++ b/newlib/libc/sys/linux/linuxthreads/libc-symbols.h
@@ -91,12 +91,12 @@
/* Define ALIASNAME as a strong alias for NAME. */
# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
# define _strong_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+ extern __typeof (name) aliasname __attribute__ ((__alias__ (#name)));
/* This comes between the return type and function name in
a function definition to make that definition weak. */
-# define weak_function __attribute__ ((weak))
-# define weak_const_function __attribute__ ((weak, __const__))
+# define weak_function __attribute__ ((__weak__))
+# define weak_const_function __attribute__ ((__weak__, __const__))
# ifdef HAVE_WEAK_SYMBOLS
@@ -104,7 +104,7 @@
If weak aliases are not available, this defines a strong alias. */
# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
# define _weak_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+ extern __typeof (name) aliasname __attribute__ ((__weak__, __alias__ (#name)));
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
# define weak_extern(symbol) _weak_extern (symbol)
@@ -213,12 +213,12 @@
# define link_warning(symbol, msg) \
__make_section_unallocated (".gnu.warning." #symbol) \
static const char __evoke_link_warning_##symbol[] \
- __attribute__ ((section (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
+ __attribute__ ((__section__ (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
# else
# define link_warning(symbol, msg) \
__make_section_unallocated (".gnu.warning." #symbol) \
static const char __evoke_link_warning_##symbol[] \
- __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
+ __attribute__ ((__section__ (".gnu.warning." #symbol "\n\t#"))) = msg;
# endif
# else /* Not ELF: a.out */
# ifdef HAVE_XCOFF
@@ -267,11 +267,11 @@
because it will need to be relocated at run time anyway. */
# define _elf_set_element(set, symbol) \
static const void *__elf_set_##set##_element_##symbol##__ \
- __attribute__ ((unused, section (#set))) = &(symbol)
+ __attribute__ ((__unused__, __section__ (#set))) = &(symbol)
# else
# define _elf_set_element(set, symbol) \
static const void *const __elf_set_##set##_element_##symbol##__ \
- __attribute__ ((unused, section (#set))) = &(symbol)
+ __attribute__ ((__unused__, __section__ (#set))) = &(symbol)
# endif
/* Define SET as a symbol set. This may be required (it is in a.out) to