Skip to content

opal: fix warning #5714

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

Merged
merged 1 commit into from
Sep 21, 2018
Merged

opal: fix warning #5714

merged 1 commit into from
Sep 21, 2018

Conversation

hjelmn
Copy link
Member

@hjelmn hjelmn commented Sep 15, 2018

Fixes #5713

Signed-off-by: Nathan Hjelm [email protected]

@@ -171,7 +171,7 @@ opal_progress_finalize(void)

static int opal_progress_events(void)
{
static volatile int32_t lock = 0;
static opal_atomic_int32_t lock = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hjelmn Note that I got a bunch of these warnings -- not just this one instance. Do you want me to post the full set locations where this warning came up on #5713?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. This is all i got on my Mac.

@jsquyres
Copy link
Member

  CC       btl_ofi_component.lo
In file included from btl_ofi_component.c:33:0:
btl_ofi.h: In function ‘mca_btl_ofi_context_trylock’:
btl_ofi.h:363:50: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     return (context->lock || OPAL_ATOMIC_SWAP_32(&context->lock, 1));
                                                  ^
In file included from ../../../../opal/class/opal_object.h:126:0,
                 from ../../../../opal/util/output.h:70,
                 from ../../../../opal/include/opal/types.h:43,
                 from ../../../../opal/mca/btl/btl.h:119,
                 from btl_ofi_component.c:27:
../../../../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)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       btl_ofi_endpoint.lo
In file included from btl_ofi_endpoint.c:14:0:
btl_ofi.h: In function ‘mca_btl_ofi_context_trylock’:
btl_ofi.h:363:50: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     return (context->lock || OPAL_ATOMIC_SWAP_32(&context->lock, 1));
                                                  ^
In file included from ../../../../opal/threads/mutex.h:31:0,
                 from ../../../../opal/class/opal_pointer_array.h:34,
                 from ../../../../opal/mca/event/event.h:28,
                 from btl_ofi.h:33,
                 from btl_ofi_endpoint.c:14:
../../../../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)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       btl_ofi_module.lo
In file included from btl_ofi_module.c:32:0:
btl_ofi.h: In function ‘mca_btl_ofi_context_trylock’:
btl_ofi.h:363:50: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     return (context->lock || OPAL_ATOMIC_SWAP_32(&context->lock, 1));
                                                  ^
In file included from ../../../../opal/class/opal_object.h:126:0,
                 from ../../../../opal/class/opal_bitmap.h:47,
                 from btl_ofi_module.c:26:
../../../../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)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       btl_ofi_rdma.lo
In file included from btl_ofi_rdma.h:19:0,
                 from btl_ofi_rdma.c:14:
btl_ofi.h: In function ‘mca_btl_ofi_context_trylock’:
btl_ofi.h:363:50: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     return (context->lock || OPAL_ATOMIC_SWAP_32(&context->lock, 1));
                                                  ^
In file included from btl_ofi_rdma.h:17:0,
                 from btl_ofi_rdma.c:14:
../../../../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)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       btl_ofi_atomics.lo
In file included from btl_ofi_rdma.h:19:0,
                 from btl_ofi_atomics.c:15:
btl_ofi.h: In function ‘mca_btl_ofi_context_trylock’:
btl_ofi.h:363:50: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     return (context->lock || OPAL_ATOMIC_SWAP_32(&context->lock, 1));
                                                  ^
In file included from btl_ofi_rdma.h:17:0,
                 from btl_ofi_atomics.c:15:
../../../../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)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       btl_ofi_frag.lo
In file included from btl_ofi_frag.c:14:0:
btl_ofi.h: In function ‘mca_btl_ofi_context_trylock’:
btl_ofi.h:363:50: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     return (context->lock || OPAL_ATOMIC_SWAP_32(&context->lock, 1));
                                                  ^
In file included from ../../../../opal/threads/mutex.h:31:0,
                 from ../../../../opal/class/opal_pointer_array.h:34,
                 from ../../../../opal/mca/event/event.h:28,
                 from btl_ofi.h:33,
                 from btl_ofi_frag.c:14:
../../../../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)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       btl_ofi_context.lo
In file included from btl_ofi_context.c:12:0:
btl_ofi.h: In function ‘mca_btl_ofi_context_trylock’:
btl_ofi.h:363:50: warning: passing argument 1 of ‘opal_thread_swap_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     return (context->lock || OPAL_ATOMIC_SWAP_32(&context->lock, 1));
                                                  ^
In file included from ../../../../opal/threads/mutex.h:31:0,
                 from ../../../../opal/class/opal_pointer_array.h:34,
                 from ../../../../opal/mca/event/event.h:28,
                 from btl_ofi.h:33,
                 from btl_ofi_context.c:12:
../../../../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)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CCLD     mca_btl_ofi.la
libtool: warning: '/home/jsquyres/libfabric-current/install/lib/libfabric.la' seems to be moved

Copy link
Member

@jsquyres jsquyres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix the other warnings, too.

Fixes open-mpi#5713

Signed-off-by: Nathan Hjelm <[email protected]>
@hjelmn
Copy link
Member Author

hjelmn commented Sep 20, 2018

Got the btl/ofi one. Let me know if there are any others.

@hjelmn hjelmn merged commit c623065 into open-mpi:master Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants