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

Concerning warnings in OSC rdma #12130

Closed
jsquyres opened this issue Nov 26, 2023 · 3 comments · Fixed by #12154
Closed

Concerning warnings in OSC rdma #12130

jsquyres opened this issue Nov 26, 2023 · 3 comments · Fixed by #12154

Comments

@jsquyres
Copy link
Member

In main and v5.0.x, the following concerning compiler warnings are emitted for the rdma OSC component:

  CC       osc_rdma_accumulate.lo
osc_rdma_accumulate.c:179:22: warning: assigning to 'void *' from 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        compare_copy = compare_addr;
                     ^ ~~~~~~~~~~~~
osc_rdma_accumulate.c:865:41: warning: passing 'const void *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                                        compare_copy, compare_addr, len, MCA_ACCELERATOR_TRANSFER_DTOH);
                                        ^~~~~~~~~~~~
osc_rdma_accumulate.c:878:14: warning: passing 'const void *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        free(compare_copy);
             ^~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:47:18: note: passing argument to parameter here
void  free(void *);
                 ^
3 warnings generated.

I generated these warnings with clang 15 on macOS Sonoma 14.1.1, but I'm betting that similar warnings will be emitted on other OSs / compilers / versions.

Note that I did fix some other compiler warnings in the rdma OSC component in #12129; hence, the warnings above are what are left after fixing those other warnings.

These warnings seem serious, but I don't grok the code well enough to properly assess and/or fix them. I tried a few simple things, but that led down a rabbit hole of const-related side issues. It will probably be better for someone who already understands what this code is meant to be doing to have a look at these warnings.

Can someone have a look?

@devreal
Copy link
Contributor

devreal commented Nov 27, 2023

I had posted a PR that fixes this a while back and totally forgot about it: #11500

@devreal
Copy link
Contributor

devreal commented Nov 27, 2023

Oh wait, never mind. That's different set of warnings that I had not seen before. I will take a look.

@devreal devreal self-assigned this Nov 27, 2023
@janjust
Copy link
Contributor

janjust commented Dec 7, 2023

@devreal just curious if you had any chance to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants