[tor-bugs] #26779 [Core Tor/Tor]: atomic_init() and friends failing on clang

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Jul 13 05:55:52 UTC 2018


#26779: atomic_init() and friends failing on clang
--------------------------+------------------------------------
 Reporter:  mikeperry     |          Owner:  nickm
     Type:  defect        |         Status:  assigned
 Priority:  Medium        |      Milestone:  Tor: 0.3.3.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  jenkins       |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by weasel):

 e.g.
 {{{
 23:02:37 In file included from src/lib/compress/compress.c:36:
 23:02:37 ./src/lib/thread/threads.h:128:3: error: address argument to
 atomic operation must be a pointer to a trivially-copyable type
 ('_Atomic(unsigned int) *' invalid)
 23:02:37   atomic_init(&counter->val, 0);
 23:02:37   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:83:3: note: expanded from macro
 'atomic_init'
 23:02:37   atomic_store_explicit (PTR, VAL, __ATOMIC_RELAXED)
 23:02:37   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:126:5: note: expanded from macro
 'atomic_store_explicit'
 23:02:37     __atomic_store (__atomic_store_ptr, &__atomic_store_tmp,
 (MO));     \
 23:02:37     ^               ~~~~~~~~~~~~~~~~~~
 23:02:37 In file included from src/lib/compress/compress.c:36:
 23:02:37 ./src/lib/thread/threads.h:140:10: error: address argument to
 atomic operation must be a pointer to integer or pointer ('atomic_size_t
 *' (aka '_Atomic(unsigned int) *') invalid)
 23:02:37   (void) atomic_fetch_add(&counter->val, add);
 23:02:37          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:192:36: note: expanded from macro
 'atomic_fetch_add'
 23:02:37 #define atomic_fetch_add(PTR, VAL) __atomic_fetch_add ((PTR),
 (VAL),    \
 23:02:37                                    ^                   ~~~~~
 23:02:37 In file included from src/lib/compress/compress.c:36:
 23:02:37 ./src/lib/thread/threads.h:146:10: error: address argument to
 atomic operation must be a pointer to integer or pointer ('atomic_size_t
 *' (aka '_Atomic(unsigned int) *') invalid)
 23:02:37   (void) atomic_fetch_sub(&counter->val, sub);
 23:02:37          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:197:36: note: expanded from macro
 'atomic_fetch_sub'
 23:02:37 #define atomic_fetch_sub(PTR, VAL) __atomic_fetch_sub ((PTR),
 (VAL),    \
 23:02:37                                    ^                   ~~~~~
 23:02:37 In file included from src/lib/compress/compress.c:36:
 23:02:37 ./src/lib/thread/threads.h:152:10: error: address argument to
 atomic operation must be a pointer to a trivially-copyable type
 ('_Atomic(unsigned int) *' invalid)
 23:02:37   return atomic_load(&counter->val);
 23:02:37          ^~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:142:27: note: expanded from macro
 'atomic_load'
 23:02:37 #define atomic_load(PTR)  atomic_load_explicit (PTR,
 __ATOMIC_SEQ_CST)
 23:02:37
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:138:5: note: expanded from macro
 'atomic_load_explicit'
 23:02:37     __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (MO));
 \
 23:02:37     ^              ~~~~~~~~~~~~~~~~~
 23:02:37 In file included from src/lib/compress/compress.c:36:
 23:02:37 ./src/lib/thread/threads.h:158:10: error: address argument to
 atomic operation must be a pointer to a trivially-copyable type
 ('_Atomic(unsigned int) *' invalid)
 23:02:37   return atomic_exchange(&counter->val, newval);
 23:02:37          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:157:3: note: expanded from macro
 'atomic_exchange'
 23:02:37   atomic_exchange_explicit (PTR, VAL, __ATOMIC_SEQ_CST)
 23:02:37   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 23:02:37 /usr/bin/../lib/gcc/i686-linux-
 gnu/7.3.0/include/stdatomic.h:151:5: note: expanded from macro
 'atomic_exchange_explicit'
 23:02:37     __atomic_exchange (__atomic_exchange_ptr,
 &__atomic_exchange_val,   \
 23:02:37     ^                  ~~~~~~~~~~~~~~~~~~~~~
 23:02:37 5 errors generated.
 23:02:37 Makefile:8039: recipe for target 'src/lib/compress/compress.o'
 failed
 23:02:37 make[1]: *** [src/lib/compress/compress.o] Error 1
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26779#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list