Skip to content

Fix compiler warnings #9814

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 2 commits into from
Jan 4, 2022
Merged

Conversation

jsquyres
Copy link
Member

@jsquyres jsquyres commented Jan 2, 2022

2 commits:

  • Fix some trivial compiler warnings in opal/util. Note that modern GCC (e.g., 10.x) has some static analysis built-in these days; you have to be a little more aggressive to stomp the compiler warnings.
  • Some active message BTL base compiler warnings about differing signedness and illegal use of flexible arrays as a struct member. Specifically:
  CC       base/btl_base_am_rdma.lo
base/btl_base_am_rdma.c:200:29: warning: invalid use of structure with flexible array member [-Wpedantic]
  200 |     mca_btl_base_rdma_hdr_t hdr;
      |                             ^~~

EDIT: After discussion on this PR, we decided not to fix the above-mentioned flexible array warning. See #9814 (comment) (below) for details. I filed #9828 to track the issue in case we ever decide to fix it someday.

@jsquyres jsquyres requested review from hjelmn and bwbarrett January 2, 2022 22:17
@jsquyres jsquyres force-pushed the pr/fix-compiler-warnings branch from 53ffd30 to 1d51da6 Compare January 3, 2022 17:42
@ibm-ompi
Copy link

ibm-ompi commented Jan 4, 2022

The IBM CI (PGI) build failed! Please review the log, linked below.

Gist: https://gist.github.com/ibm-ompi/88b480fb98dfd2bdac939f023e1f8fe6

@jjhursey
Copy link
Member

jjhursey commented Jan 4, 2022

bot:ibm:pgi:retest

Note that free(NULL) is legal in C99, so remove the
"__opal_attribute_nonnull__(1)" attribute from the buffer param to
opal_free() debug wrapper.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Also, remove a superflous (uintptr_t) cast, and add an obvious "else"
to make the code a little more readable.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
@jsquyres jsquyres force-pushed the pr/fix-compiler-warnings branch from ba33916 to a24846e Compare January 4, 2022 21:57
@jsquyres jsquyres requested a review from bosilca January 4, 2022 22:33
@jsquyres jsquyres merged commit 65cf76e into open-mpi:master Jan 4, 2022
@jsquyres jsquyres deleted the pr/fix-compiler-warnings branch January 4, 2022 22:45
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.

6 participants