Skip to content
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

put w/signal warning with shmem_wait_until #814

Closed
davidozog opened this issue Dec 10, 2018 · 3 comments
Closed

put w/signal warning with shmem_wait_until #814

davidozog opened this issue Dec 10, 2018 · 3 comments

Comments

@davidozog
Copy link
Member

I've been seeing these compiler warnings lately when building the shmemx tests:

../../../test/shmemx/put_signal_nbi.c: In function 'main':
../../../test/shmemx/put_signal_nbi.c:70:5: warning: pointer targets in passing argument 1 of 'shmem_wait_until' differ in signedness [-Wpointer-sign]
     shmem_wait_until(&sig_addr, SHMEM_CMP_EQ, 1);
     ^
In file included from ../../../test/shmemx/put_signal_nbi.c:34:0:
../../mpp/shmem.h:1602:32: note: expected 'long int *' but argument is of type 'uint64_t *'
 SHMEM_FUNCTION_ATTRIBUTES void shmem_wait_until(long *ivar, int cmp, long value);
                                ^
  ../../../test/shmemx/put_signal.c: In function 'main':
../../../test/shmemx/put_signal.c:68:9: warning: pointer targets in passing argument 1 of 'shmem_wait_until' differ in signedness [-Wpointer-sign]
         shmem_wait_until(&sig_addr, SHMEM_CMP_EQ, 1);
         ^
In file included from ../../../test/shmemx/put_signal.c:35:0:
../../mpp/shmem.h:1602:32: note: expected 'long int *' but argument is of type 'uint64_t *'
 SHMEM_FUNCTION_ATTRIBUTES void shmem_wait_until(long *ivar, int cmp, long value);
                                ^
../../../test/shmemx/put_signal.c:70:9: warning: pointer targets in passing argument 1 of 'shmem_wait_until' differ in signedness [-Wpointer-sign]
         shmem_wait_until(&sig_addr, SHMEM_CMP_EQ, 1);
         ^
In file included from ../../../test/shmemx/put_signal.c:35:0:
../../mpp/shmem.h:1602:32: note: expected 'long int *' but argument is of type 'uint64_t *'
 SHMEM_FUNCTION_ATTRIBUTES void shmem_wait_until(long *ivar, int cmp, long value);
                                ^

It looks like this compiler (gcc in Travis's Trusty image) does not have C11 generic support and ends up using the legacy untyped API (with a long 1st argument) here.

We might be better off using the shmem_uint64_wait_until in the put_signal and put_signal_nbi tests.

@wrrobin
Copy link
Collaborator

wrrobin commented Dec 10, 2018

@davidozog Thanks for posting the issue. Will fix this in the optimized implementation.

@jdinan
Copy link
Member

jdinan commented Dec 11, 2018

You can use the generic routine as long as you wrap it as follows:

#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
     shmem_wait_until(&sig_addr, SHMEM_CMP_EQ, 1);
#else
     shmem_uint64_wait_until(&sig_addr, SHMEM_CMP_EQ, 1);
#endif

wrrobin added a commit to wrrobin/SOS that referenced this issue Dec 11, 2018
@wrrobin
Copy link
Collaborator

wrrobin commented Jan 7, 2019

Closed by #815

@wrrobin wrrobin closed this as completed Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants