Skip to content

Argobots: Missing _Atomic qualifier in threads_argobots_mutex.c #7697

Closed
@devreal

Description

@devreal

I tried building the Argobots integration with the current Clang trunk while testing #7675. Clang seems to be more strict about the _Atomic qualifier than GCC so the build fails:

../../../../../opal/mca/threads/argobots/threads_argobots_mutex.c:107:13: error: address argument to atomic operation must be a pointer to _Atomic type ('intptr_t *' (aka 'long *') invalid)
        if (opal_atomic_compare_exchange_strong_ptr(
            ^
../../../../../opal/include/opal/sys/atomic_stdc.h:91:71: note: expanded from macro 'opal_atomic_compare_exchange_strong_ptr'
#define opal_atomic_compare_exchange_strong_ptr(addr, compare, value) atomic_compare_exchange_strong_explicit (addr, compare, value, memory_order_relaxed, memory_order_relaxed)
                                                                      ^                                        ~~~~
/home/h4/jschuch/opt/clang-trunk/lib/clang/11.0.0/include/stdatomic.h:127:49: note: expanded from macro 'atomic_compare_exchange_strong_explicit'
#define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong
                                                ^
../../../../../opal/mca/threads/argobots/threads_argobots_mutex.c:124:13: error: address argument to atomic operation must be a pointer to _Atomic type ('intptr_t *' (aka 'long *') invalid)
        if (opal_atomic_compare_exchange_strong_ptr((intptr_t *)cond,
            ^                                       ~~~~~~~~~~~~~~~~
../../../../../opal/include/opal/sys/atomic_stdc.h:91:71: note: expanded from macro 'opal_atomic_compare_exchange_strong_ptr'
#define opal_atomic_compare_exchange_strong_ptr(addr, compare, value) atomic_compare_exchange_strong_explicit (addr, compare, value, memory_order_relaxed, memory_order_relaxed)
                                                                      ^                                        ~~~~
/home/h4/jschuch/opt/clang-trunk/lib/clang/11.0.0/include/stdatomic.h:127:49: note: expanded from macro 'atomic_compare_exchange_strong_explicit'
#define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong
                                                ^
2 errors generated.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions