-
Notifications
You must be signed in to change notification settings - Fork 900
gcc 14 and clang 18 compiler warning fixes #12743
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
jsquyres
merged 9 commits into
open-mpi:main
from
jsquyres:pr/gcc-14-compiler-warning-fixes
Sep 2, 2024
Merged
gcc 14 and clang 18 compiler warning fixes #12743
jsquyres
merged 9 commits into
open-mpi:main
from
jsquyres:pr/gcc-14-compiler-warning-fixes
Sep 2, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bosilca
approved these changes
Aug 11, 2024
lrbison
approved these changes
Aug 12, 2024
devreal
requested changes
Aug 12, 2024
7a2203c
to
dae9712
Compare
lrbison
approved these changes
Aug 13, 2024
The copy_type tests had what looked like a copy-and-paste error of testing the arguments. This was found by gcc 14's static analyzer. Signed-off-by: Jeff Squyres <[email protected]>
Add missing "void" in declaration. I'm amazed that this survived so long. Signed-off-by: Jeff Squyres <[email protected]>
Without this check, gcc 14's static analyzer emits a warning about possible out-of-bounds array subscripts. Signed-off-by: Jeff Squyres <[email protected]>
1. Guarantee that strings are \0 by using opal_string_copy() 2. Ensure that a temporary string buffer is long enough to hold odd sprintf values for "%3d" (e.g., error values) Without these changes, gcc 14's static analyzer emitted warnings. Signed-off-by: Jeff Squyres <[email protected]>
Without these changes, gcc 14's static analyzer emitted warnings. Signed-off-by: Jeff Squyres <[email protected]>
No need to use a "*(void**)" cast+dereference; cast to (intptr_t) and then to (void*) to get the correct type. Without this fix, gcc 14's static analyzer emitted warnings about reading out of bounds. Signed-off-by: Jeff Squyres <[email protected]>
In reality, it's extremely unlikely (or possibly impossible?) for member_id to get through the loop without being assigned. But gcc 14's static analyzer flags it as possible and emits a warning. So initially assign it to -1 and put in an assert() to catch (in debug builds) if it isn't assigned. Signed-off-by: Jeff Squyres <[email protected]>
Put in an explicit cast to (double) to avoid a gcc 14 warning about a loss of precision compared to the implicit cast. Signed-off-by: Jeff Squyres <[email protected]>
@devreal Matt provided a new patch; can you re-review? |
dae9712
to
e311b21
Compare
Without this fix, gcc 14's static analyzer complains about the signedness of some comparisons. Signed-off-by: Matthew G. F. Dosanjh <[email protected]> Signed-off-by: Jeff Squyres <[email protected]>
e311b21
to
6e81b00
Compare
devreal
approved these changes
Sep 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Initially making this a draft PR because at least some of these individual commits need a close review.
Please see individual commit messages for details.