Skip to content

Atomic compiler warnings (from C11 atomic PR) #5713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jsquyres opened this issue Sep 15, 2018 · 2 comments
Closed

Atomic compiler warnings (from C11 atomic PR) #5713

jsquyres opened this issue Sep 15, 2018 · 2 comments

Comments

@jsquyres
Copy link
Member

I am seeing lots of these warnings on master HEAD when compiling with gcc 7.3.0 on RHEL 6.x:

runtime/opal_progress.c: In function ‘opal_progress_events’:
runtime/opal_progress.c:177:63: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     if( opal_progress_event_flag != 0 && !OPAL_THREAD_SWAP_32(&lock, 1) ) {
                                                               ^
In file included from ../opal/threads/mutex.h:31:0,
                 from ../opal/runtime/opal_progress.h:34,
                 from runtime/opal_progress.c:32:
../opal/threads/thread_usage.h:136:20: note: expected ‘_Atomic opal_atomic_int32_t * {aka _Atomic int *}’ but argument is of type ‘volatile int32_t * {aka volatile int *}’
 static inline type opal_thread_swap_ ## suffix (opal_atomic_ ## addr_type *ptr, type newvalue)                     ^
../opal/threads/thread_usage.h:158:1: note: in expansion of macro ‘OPAL_THREAD_DEFINE_ATOMIC_SWAP’
 OPAL_THREAD_DEFINE_ATOMIC_SWAP(int32_t, int32_t, 32)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bisecting shows that fe6528b (i.e., PR #5445, "Update opal to use C11 atomics if available") is the culprit.

@hjelmn can you please have a look? Thanks!

@hjelmn
Copy link
Member

hjelmn commented Sep 15, 2018

Ah, missed that one. Will fix.

@hjelmn
Copy link
Member

hjelmn commented Sep 15, 2018

For the record warnings of this form mean that an atomic is called on a non-atomic type.

hjelmn added a commit to hjelmn/ompi that referenced this issue Sep 15, 2018
Fixes open-mpi#5713

Signed-off-by: Nathan Hjelm <[email protected]>
hjelmn added a commit to hjelmn/ompi that referenced this issue Sep 20, 2018
Fixes open-mpi#5713

Signed-off-by: Nathan Hjelm <[email protected]>
hjelmn added a commit that referenced this issue Sep 21, 2018
Fixes #5713

Signed-off-by: Nathan Hjelm <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants