]> granicus.if.org Git - libatomic_ops/commitdiff
Place no_sanitize attributes in a GCC-compliant way
authorIvan Maidanski <ivmai@mail.ru>
Sun, 19 Nov 2017 07:41:30 +0000 (10:41 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 19 Nov 2017 07:41:30 +0000 (10:41 +0300)
(fix commits 9020c5dbc058d9dc)

Now the attributes precede the function prototypes (the format is:
<attribute> void f(void) <body>).

* src/atomic_ops/generalize-arithm.template
(AO_XSIZE_fetch_and_add_full, AO_XSIZE_fetch_and_add_acquire,
AO_XSIZE_fetch_and_add_release, AO_XSIZE_fetch_and_add,
AO_XSIZE_and_full, AO_XSIZE_or_full, AO_XSIZE_xor_full): Move
AO_ATTR_NO_SANITIZE_THREAD attribute to the beginning of the function
prototype (to be right before AO_INLINE).
* src/atomic_ops/generalize-small.template (AO_XSIZE_load_read,
AO_XSIZE_load_full, AO_XSIZE_load_acquire, AO_XSIZE_load,
AO_XSIZE_store_write, AO_XSIZE_store, AO_XSIZE_store_release,
AO_XSIZE_store_full): Likewise.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_push_explicit_aux_release): Likewise.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE]
(AO_stack_push_release, AO_stack_pop_acquire): Likewise.
* tests/test_atomic.c [AO_HAVE_test_and_set_acquire] (do_junk):
Likewise.
* tests/test_malloc.c (cons): Likewise.
* src/atomic_ops/generalize-small.template (AO_XSIZE_store_write,
AO_XSIZE_store, AO_XSIZE_store_release, AO_XSIZE_store_full): Move
AO_ATTR_NO_SANITIZE_MEMORY attribute to the beginning of the function
prototype.
* src/atomic_ops/generalize-arithm.h: Regenerate.
* src/atomic_ops/generalize-small.h: Likewise.

src/atomic_ops/generalize-arithm.h
src/atomic_ops/generalize-arithm.template
src/atomic_ops/generalize-small.h
src/atomic_ops/generalize-small.template
src/atomic_ops_stack.c
tests/test_atomic.c
tests/test_malloc.c

index 27ccf9bd277481597d8dc691afa146f6528f5c9a..515f52e9e15a55aa15364e8e4b64c9cf61f2f3f7 100644 (file)
 /* corresponding compare_and_swap variants to minimize adding barriers. */
 #if defined(AO_HAVE_char_compare_and_swap_full) \
     && !defined(AO_HAVE_char_fetch_and_add_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
   AO_char_fetch_and_add_full(volatile unsigned/**/char *addr, unsigned/**/char incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old;
 
 
 #if defined(AO_HAVE_char_compare_and_swap_acquire) \
     && !defined(AO_HAVE_char_fetch_and_add_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
   AO_char_fetch_and_add_acquire(volatile unsigned/**/char *addr, unsigned/**/char incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old;
 
 
 #if defined(AO_HAVE_char_compare_and_swap_release) \
     && !defined(AO_HAVE_char_fetch_and_add_release)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
   AO_char_fetch_and_add_release(volatile unsigned/**/char *addr, unsigned/**/char incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old;
 
 
 #if defined(AO_HAVE_char_compare_and_swap) \
     && !defined(AO_HAVE_char_fetch_and_add)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
   AO_char_fetch_and_add(volatile unsigned/**/char *addr, unsigned/**/char incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old;
 
 /* char_and */
 #if defined(AO_HAVE_char_compare_and_swap_full) \
     && !defined(AO_HAVE_char_and_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_char_and_full(volatile unsigned/**/char *addr, unsigned/**/char value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old;
 
 /* char_or */
 #if defined(AO_HAVE_char_compare_and_swap_full) \
     && !defined(AO_HAVE_char_or_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_char_or_full(volatile unsigned/**/char *addr, unsigned/**/char value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old;
 
 /* char_xor */
 #if defined(AO_HAVE_char_compare_and_swap_full) \
     && !defined(AO_HAVE_char_xor_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_char_xor_full(volatile unsigned/**/char *addr, unsigned/**/char value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old;
 
 /* corresponding compare_and_swap variants to minimize adding barriers. */
 #if defined(AO_HAVE_short_compare_and_swap_full) \
     && !defined(AO_HAVE_short_fetch_and_add_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
   AO_short_fetch_and_add_full(volatile unsigned/**/short *addr, unsigned/**/short incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old;
 
 
 #if defined(AO_HAVE_short_compare_and_swap_acquire) \
     && !defined(AO_HAVE_short_fetch_and_add_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
   AO_short_fetch_and_add_acquire(volatile unsigned/**/short *addr, unsigned/**/short incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old;
 
 
 #if defined(AO_HAVE_short_compare_and_swap_release) \
     && !defined(AO_HAVE_short_fetch_and_add_release)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
   AO_short_fetch_and_add_release(volatile unsigned/**/short *addr, unsigned/**/short incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old;
 
 
 #if defined(AO_HAVE_short_compare_and_swap) \
     && !defined(AO_HAVE_short_fetch_and_add)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
   AO_short_fetch_and_add(volatile unsigned/**/short *addr, unsigned/**/short incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old;
 
 /* short_and */
 #if defined(AO_HAVE_short_compare_and_swap_full) \
     && !defined(AO_HAVE_short_and_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_short_and_full(volatile unsigned/**/short *addr, unsigned/**/short value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old;
 
 /* short_or */
 #if defined(AO_HAVE_short_compare_and_swap_full) \
     && !defined(AO_HAVE_short_or_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_short_or_full(volatile unsigned/**/short *addr, unsigned/**/short value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old;
 
 /* short_xor */
 #if defined(AO_HAVE_short_compare_and_swap_full) \
     && !defined(AO_HAVE_short_xor_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_short_xor_full(volatile unsigned/**/short *addr, unsigned/**/short value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old;
 
 /* corresponding compare_and_swap variants to minimize adding barriers. */
 #if defined(AO_HAVE_int_compare_and_swap_full) \
     && !defined(AO_HAVE_int_fetch_and_add_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
   AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old;
 
 
 #if defined(AO_HAVE_int_compare_and_swap_acquire) \
     && !defined(AO_HAVE_int_fetch_and_add_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
   AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old;
 
 
 #if defined(AO_HAVE_int_compare_and_swap_release) \
     && !defined(AO_HAVE_int_fetch_and_add_release)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
   AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old;
 
 
 #if defined(AO_HAVE_int_compare_and_swap) \
     && !defined(AO_HAVE_int_fetch_and_add)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
   AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old;
 
 /* int_and */
 #if defined(AO_HAVE_int_compare_and_swap_full) \
     && !defined(AO_HAVE_int_and_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_int_and_full(volatile unsigned *addr, unsigned value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old;
 
 /* int_or */
 #if defined(AO_HAVE_int_compare_and_swap_full) \
     && !defined(AO_HAVE_int_or_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_int_or_full(volatile unsigned *addr, unsigned value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old;
 
 /* int_xor */
 #if defined(AO_HAVE_int_compare_and_swap_full) \
     && !defined(AO_HAVE_int_xor_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_int_xor_full(volatile unsigned *addr, unsigned value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old;
 
 /* corresponding compare_and_swap variants to minimize adding barriers. */
 #if defined(AO_HAVE_compare_and_swap_full) \
     && !defined(AO_HAVE_fetch_and_add_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
   AO_fetch_and_add_full(volatile AO_t *addr, AO_t incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old;
 
 
 #if defined(AO_HAVE_compare_and_swap_acquire) \
     && !defined(AO_HAVE_fetch_and_add_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
   AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old;
 
 
 #if defined(AO_HAVE_compare_and_swap_release) \
     && !defined(AO_HAVE_fetch_and_add_release)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
   AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old;
 
 
 #if defined(AO_HAVE_compare_and_swap) \
     && !defined(AO_HAVE_fetch_and_add)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
   AO_fetch_and_add(volatile AO_t *addr, AO_t incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old;
 
 /* and */
 #if defined(AO_HAVE_compare_and_swap_full) \
     && !defined(AO_HAVE_and_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_and_full(volatile AO_t *addr, AO_t value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old;
 
 /* or */
 #if defined(AO_HAVE_compare_and_swap_full) \
     && !defined(AO_HAVE_or_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_or_full(volatile AO_t *addr, AO_t value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old;
 
 /* xor */
 #if defined(AO_HAVE_compare_and_swap_full) \
     && !defined(AO_HAVE_xor_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_xor_full(volatile AO_t *addr, AO_t value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old;
 
index 69735fd4a7a1cf0dcea33a0672984809499ae49b..0a21ec234b4190a1745de6d7721236daa8c04855 100644 (file)
 /* corresponding compare_and_swap variants to minimize adding barriers. */
 #if defined(AO_HAVE_XSIZE_compare_and_swap_full) \
     && !defined(AO_HAVE_XSIZE_fetch_and_add_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
   AO_XSIZE_fetch_and_add_full(volatile XCTYPE *addr, XCTYPE incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap_acquire) \
     && !defined(AO_HAVE_XSIZE_fetch_and_add_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
   AO_XSIZE_fetch_and_add_acquire(volatile XCTYPE *addr, XCTYPE incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap_release) \
     && !defined(AO_HAVE_XSIZE_fetch_and_add_release)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
   AO_XSIZE_fetch_and_add_release(volatile XCTYPE *addr, XCTYPE incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap) \
     && !defined(AO_HAVE_XSIZE_fetch_and_add)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
   AO_XSIZE_fetch_and_add(volatile XCTYPE *addr, XCTYPE incr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old;
 
 /* XSIZE_and */
 #if defined(AO_HAVE_XSIZE_compare_and_swap_full) \
     && !defined(AO_HAVE_XSIZE_and_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_XSIZE_and_full(volatile XCTYPE *addr, XCTYPE value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old;
 
 /* XSIZE_or */
 #if defined(AO_HAVE_XSIZE_compare_and_swap_full) \
     && !defined(AO_HAVE_XSIZE_or_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_XSIZE_or_full(volatile XCTYPE *addr, XCTYPE value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old;
 
 /* XSIZE_xor */
 #if defined(AO_HAVE_XSIZE_compare_and_swap_full) \
     && !defined(AO_HAVE_XSIZE_xor_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_XSIZE_xor_full(volatile XCTYPE *addr, XCTYPE value)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old;
 
index 8e26abf93598a8720b20bda8b3792cf5bdd11a80..d93d0e827bfa3d783e1d4bb593b83409d21098d5 100644 (file)
 #if defined(AO_HAVE_char_compare_and_swap_read) \
     && !defined(AO_HAVE_char_load_read)
 # define AO_char_CAS_BASED_LOAD_READ
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
-  AO_char_load_read(const volatile unsigned/**/char *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_char_load_read(const volatile unsigned/**/char *addr)
   {
     unsigned/**/char result;
 
 
 #if defined(AO_HAVE_char_compare_and_swap_full) \
     && !defined(AO_HAVE_char_load_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
-  AO_char_load_full(const volatile unsigned/**/char *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_char_load_full(const volatile unsigned/**/char *addr)
   {
     unsigned/**/char result;
 
 
 #if defined(AO_HAVE_char_compare_and_swap_acquire) \
     && !defined(AO_HAVE_char_load_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
   AO_char_load_acquire(const volatile unsigned/**/char *addr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char result;
 
 #endif
 
 #if defined(AO_HAVE_char_compare_and_swap) && !defined(AO_HAVE_char_load)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/char
-  AO_char_load(const volatile unsigned/**/char *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_char_load(const volatile unsigned/**/char *addr)
   {
     unsigned/**/char result;
 
 
 #if defined(AO_HAVE_char_compare_and_swap_write) \
     && !defined(AO_HAVE_char_store_write)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_char_store_write(volatile unsigned/**/char *addr, unsigned/**/char new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old_val;
 
 #endif
 
 #if defined(AO_HAVE_char_compare_and_swap) && !defined(AO_HAVE_char_store)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_char_store(volatile unsigned/**/char *addr, unsigned/**/char new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old_val;
 
 
 #if defined(AO_HAVE_char_compare_and_swap_release) \
     && !defined(AO_HAVE_char_store_release)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_char_store_release(volatile unsigned/**/char *addr, unsigned/**/char new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old_val;
 
 
 #if defined(AO_HAVE_char_compare_and_swap_full) \
     && !defined(AO_HAVE_char_store_full)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_char_store_full(volatile unsigned/**/char *addr, unsigned/**/char new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/char old_val;
 
 #if defined(AO_HAVE_short_compare_and_swap_read) \
     && !defined(AO_HAVE_short_load_read)
 # define AO_short_CAS_BASED_LOAD_READ
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
-  AO_short_load_read(const volatile unsigned/**/short *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_short_load_read(const volatile unsigned/**/short *addr)
   {
     unsigned/**/short result;
 
 
 #if defined(AO_HAVE_short_compare_and_swap_full) \
     && !defined(AO_HAVE_short_load_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
-  AO_short_load_full(const volatile unsigned/**/short *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_short_load_full(const volatile unsigned/**/short *addr)
   {
     unsigned/**/short result;
 
 
 #if defined(AO_HAVE_short_compare_and_swap_acquire) \
     && !defined(AO_HAVE_short_load_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
   AO_short_load_acquire(const volatile unsigned/**/short *addr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short result;
 
 #endif
 
 #if defined(AO_HAVE_short_compare_and_swap) && !defined(AO_HAVE_short_load)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned/**/short
-  AO_short_load(const volatile unsigned/**/short *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_short_load(const volatile unsigned/**/short *addr)
   {
     unsigned/**/short result;
 
 
 #if defined(AO_HAVE_short_compare_and_swap_write) \
     && !defined(AO_HAVE_short_store_write)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_short_store_write(volatile unsigned/**/short *addr, unsigned/**/short new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old_val;
 
 #endif
 
 #if defined(AO_HAVE_short_compare_and_swap) && !defined(AO_HAVE_short_store)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_short_store(volatile unsigned/**/short *addr, unsigned/**/short new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old_val;
 
 
 #if defined(AO_HAVE_short_compare_and_swap_release) \
     && !defined(AO_HAVE_short_store_release)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_short_store_release(volatile unsigned/**/short *addr, unsigned/**/short new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old_val;
 
 
 #if defined(AO_HAVE_short_compare_and_swap_full) \
     && !defined(AO_HAVE_short_store_full)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_short_store_full(volatile unsigned/**/short *addr, unsigned/**/short new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned/**/short old_val;
 
 #if defined(AO_HAVE_int_compare_and_swap_read) \
     && !defined(AO_HAVE_int_load_read)
 # define AO_int_CAS_BASED_LOAD_READ
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
-  AO_int_load_read(const volatile unsigned *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_int_load_read(const volatile unsigned *addr)
   {
     unsigned result;
 
 
 #if defined(AO_HAVE_int_compare_and_swap_full) \
     && !defined(AO_HAVE_int_load_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
-  AO_int_load_full(const volatile unsigned *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_int_load_full(const volatile unsigned *addr)
   {
     unsigned result;
 
 
 #if defined(AO_HAVE_int_compare_and_swap_acquire) \
     && !defined(AO_HAVE_int_load_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
   AO_int_load_acquire(const volatile unsigned *addr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned result;
 
 #endif
 
 #if defined(AO_HAVE_int_compare_and_swap) && !defined(AO_HAVE_int_load)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE unsigned
-  AO_int_load(const volatile unsigned *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_int_load(const volatile unsigned *addr)
   {
     unsigned result;
 
 
 #if defined(AO_HAVE_int_compare_and_swap_write) \
     && !defined(AO_HAVE_int_store_write)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_int_store_write(volatile unsigned *addr, unsigned new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old_val;
 
 #endif
 
 #if defined(AO_HAVE_int_compare_and_swap) && !defined(AO_HAVE_int_store)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_int_store(volatile unsigned *addr, unsigned new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old_val;
 
 
 #if defined(AO_HAVE_int_compare_and_swap_release) \
     && !defined(AO_HAVE_int_store_release)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_int_store_release(volatile unsigned *addr, unsigned new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old_val;
 
 
 #if defined(AO_HAVE_int_compare_and_swap_full) \
     && !defined(AO_HAVE_int_store_full)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_int_store_full(volatile unsigned *addr, unsigned new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     unsigned old_val;
 
 #if defined(AO_HAVE_compare_and_swap_read) \
     && !defined(AO_HAVE_load_read)
 # define AO_CAS_BASED_LOAD_READ
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
-  AO_load_read(const volatile AO_t *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_load_read(const volatile AO_t *addr)
   {
     AO_t result;
 
 
 #if defined(AO_HAVE_compare_and_swap_full) \
     && !defined(AO_HAVE_load_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
-  AO_load_full(const volatile AO_t *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_load_full(const volatile AO_t *addr)
   {
     AO_t result;
 
 
 #if defined(AO_HAVE_compare_and_swap_acquire) \
     && !defined(AO_HAVE_load_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
   AO_load_acquire(const volatile AO_t *addr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t result;
 
 #endif
 
 #if defined(AO_HAVE_compare_and_swap) && !defined(AO_HAVE_load)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_t
-  AO_load(const volatile AO_t *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_load(const volatile AO_t *addr)
   {
     AO_t result;
 
 
 #if defined(AO_HAVE_compare_and_swap_write) \
     && !defined(AO_HAVE_store_write)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_store_write(volatile AO_t *addr, AO_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old_val;
 
 #endif
 
 #if defined(AO_HAVE_compare_and_swap) && !defined(AO_HAVE_store)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_store(volatile AO_t *addr, AO_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old_val;
 
 
 #if defined(AO_HAVE_compare_and_swap_release) \
     && !defined(AO_HAVE_store_release)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_store_release(volatile AO_t *addr, AO_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old_val;
 
 
 #if defined(AO_HAVE_compare_and_swap_full) \
     && !defined(AO_HAVE_store_full)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_store_full(volatile AO_t *addr, AO_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_t old_val;
 
 #if defined(AO_HAVE_double_compare_and_swap_read) \
     && !defined(AO_HAVE_double_load_read)
 # define AO_double_CAS_BASED_LOAD_READ
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_double_t
-  AO_double_load_read(const volatile AO_double_t *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_double_load_read(const volatile AO_double_t *addr)
   {
     AO_double_t result;
 
 
 #if defined(AO_HAVE_double_compare_and_swap_full) \
     && !defined(AO_HAVE_double_load_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_double_t
-  AO_double_load_full(const volatile AO_double_t *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_double_load_full(const volatile AO_double_t *addr)
   {
     AO_double_t result;
 
 
 #if defined(AO_HAVE_double_compare_and_swap_acquire) \
     && !defined(AO_HAVE_double_load_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_double_t
   AO_double_load_acquire(const volatile AO_double_t *addr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_double_t result;
 
 #endif
 
 #if defined(AO_HAVE_double_compare_and_swap) && !defined(AO_HAVE_double_load)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE AO_double_t
-  AO_double_load(const volatile AO_double_t *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_double_load(const volatile AO_double_t *addr)
   {
     AO_double_t result;
 
 
 #if defined(AO_HAVE_double_compare_and_swap_write) \
     && !defined(AO_HAVE_double_store_write)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_double_store_write(volatile AO_double_t *addr, AO_double_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_double_t old_val;
 
 #endif
 
 #if defined(AO_HAVE_double_compare_and_swap) && !defined(AO_HAVE_double_store)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_double_store(volatile AO_double_t *addr, AO_double_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_double_t old_val;
 
 
 #if defined(AO_HAVE_double_compare_and_swap_release) \
     && !defined(AO_HAVE_double_store_release)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_double_store_release(volatile AO_double_t *addr, AO_double_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_double_t old_val;
 
 
 #if defined(AO_HAVE_double_compare_and_swap_full) \
     && !defined(AO_HAVE_double_store_full)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_double_store_full(volatile AO_double_t *addr, AO_double_t new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     AO_double_t old_val;
 
index 99e96a1d134eb7404c5709c5aa1ec9a79aeb5d16..d3490f87b0b96396dd2587dc07c940e4a74fb534 100644 (file)
 #if defined(AO_HAVE_XSIZE_compare_and_swap_read) \
     && !defined(AO_HAVE_XSIZE_load_read)
 # define AO_XSIZE_CAS_BASED_LOAD_READ
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
-  AO_XSIZE_load_read(const volatile XCTYPE *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_XSIZE_load_read(const volatile XCTYPE *addr)
   {
     XCTYPE result;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap_full) \
     && !defined(AO_HAVE_XSIZE_load_full)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
-  AO_XSIZE_load_full(const volatile XCTYPE *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_XSIZE_load_full(const volatile XCTYPE *addr)
   {
     XCTYPE result;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap_acquire) \
     && !defined(AO_HAVE_XSIZE_load_acquire)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
   AO_XSIZE_load_acquire(const volatile XCTYPE *addr)
-                                                AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE result;
 
 #endif
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap) && !defined(AO_HAVE_XSIZE_load)
+  AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE XCTYPE
-  AO_XSIZE_load(const volatile XCTYPE *addr) AO_ATTR_NO_SANITIZE_THREAD
+  AO_XSIZE_load(const volatile XCTYPE *addr)
   {
     XCTYPE result;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap_write) \
     && !defined(AO_HAVE_XSIZE_store_write)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_XSIZE_store_write(volatile XCTYPE *addr, XCTYPE new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old_val;
 
 #endif
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap) && !defined(AO_HAVE_XSIZE_store)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_XSIZE_store(volatile XCTYPE *addr, XCTYPE new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old_val;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap_release) \
     && !defined(AO_HAVE_XSIZE_store_release)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_XSIZE_store_release(volatile XCTYPE *addr, XCTYPE new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old_val;
 
 
 #if defined(AO_HAVE_XSIZE_compare_and_swap_full) \
     && !defined(AO_HAVE_XSIZE_store_full)
+  AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   AO_INLINE void
   AO_XSIZE_store_full(volatile XCTYPE *addr, XCTYPE new_val)
-                        AO_ATTR_NO_SANITIZE_MEMORY AO_ATTR_NO_SANITIZE_THREAD
   {
     XCTYPE old_val;
 
index c66533d4786ceef6ed35c918958f1b4ae0f0a0ce..b57ed854f34bd782bfad88c6ac17ab26ebdb2f48 100644 (file)
@@ -46,9 +46,9 @@
 /* to be inserted.                                                      */
 /* Both list headers and link fields contain "perturbed" pointers, i.e. */
 /* pointers with extra bits "or"ed into the low order bits.             */
-void
-AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x,
-                                   AO_stack_aux *a) AO_ATTR_NO_SANITIZE_THREAD
+AO_ATTR_NO_SANITIZE_THREAD
+void AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x,
+                                        AO_stack_aux *a)
 {
   AO_t x_bits = (AO_t)x;
   AO_t next;
@@ -207,8 +207,8 @@ AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux * a)
   volatile /* non-static */ AO_t AO_noop_sink;
 #endif
 
+AO_ATTR_NO_SANITIZE_THREAD
 void AO_stack_push_release(AO_stack_t *list, AO_t *element)
-                                                AO_ATTR_NO_SANITIZE_THREAD
 {
     AO_t next;
 
@@ -227,7 +227,8 @@ void AO_stack_push_release(AO_stack_t *list, AO_t *element)
 #   endif
 }
 
-AO_t *AO_stack_pop_acquire(AO_stack_t *list) AO_ATTR_NO_SANITIZE_THREAD
+AO_ATTR_NO_SANITIZE_THREAD
+AO_t *AO_stack_pop_acquire(AO_stack_t *list)
 {
 #   ifdef __clang__
       AO_t *volatile cptr;
index 8b57bd68668e13ef7bd78d6d92265c2315e50db1..e4a19a5e296af8759b69d4f4592a5b8ee6abc3ec 100644 (file)
@@ -137,7 +137,8 @@ AO_TS_t lock = AO_TS_INITIALIZER;
 unsigned long locked_counter;
 volatile unsigned long junk = 13;
 
-void do_junk(void) AO_ATTR_NO_SANITIZE_THREAD
+AO_ATTR_NO_SANITIZE_THREAD
+void do_junk(void)
 {
   junk *= 17;
   junk *= 19;
index b51d4fb0161282733c550246acb20220b631c76e..a322099d1b0102ad28929dfa7b9759660273637f 100644 (file)
@@ -68,7 +68,8 @@ typedef struct list_node {
         int data;
 } ln;
 
-ln *cons(int d, ln *tail) AO_ATTR_NO_SANITIZE_THREAD
+AO_ATTR_NO_SANITIZE_THREAD
+ln *cons(int d, ln *tail)
 {
   static size_t extra = 0; /* data race in extra is OK */
   size_t my_extra = extra;