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

gcc 14 and clang 18 compiler warning fixes #12743

Merged
merged 9 commits into from
Sep 2, 2024

Conversation

jsquyres
Copy link
Member

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.

ompi/mca/part/persist/part_persist_request.h Outdated Show resolved Hide resolved
opal/datatype/opal_datatype_copy.c Show resolved Hide resolved
ompi/mca/coll/han/coll_han_alltoall.c Outdated Show resolved Hide resolved
@jsquyres jsquyres force-pushed the pr/gcc-14-compiler-warning-fixes branch from 7a2203c to dae9712 Compare August 13, 2024 00:08
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 <jeff@squyres.com>
Add missing "void" in declaration.  I'm amazed that this survived so
long.

Signed-off-by: Jeff Squyres <jeff@squyres.com>
Without this check, gcc 14's static analyzer emits a warning about
possible out-of-bounds array subscripts.

Signed-off-by: Jeff Squyres <jeff@squyres.com>
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 <jeff@squyres.com>
Without these changes, gcc 14's static analyzer emitted warnings.

Signed-off-by: Jeff Squyres <jeff@squyres.com>
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 <jeff@squyres.com>
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 <jeff@squyres.com>
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 <jeff@squyres.com>
@jsquyres jsquyres marked this pull request as ready for review August 31, 2024 22:20
@jsquyres
Copy link
Member Author

@devreal Matt provided a new patch; can you re-review?

@jsquyres jsquyres requested a review from devreal August 31, 2024 22:20
@jsquyres jsquyres force-pushed the pr/gcc-14-compiler-warning-fixes branch from dae9712 to e311b21 Compare August 31, 2024 22:21
Without this fix, gcc 14's static analyzer complains about the
signedness of some comparisons.

Signed-off-by: Matthew G. F. Dosanjh <mdosanj@sandia.gov>
Signed-off-by: Jeff Squyres <jeff@squyres.com>
@jsquyres jsquyres force-pushed the pr/gcc-14-compiler-warning-fixes branch from e311b21 to 6e81b00 Compare August 31, 2024 22:34
@jsquyres jsquyres merged commit 72c952d into open-mpi:main Sep 2, 2024
14 checks passed
@jsquyres jsquyres deleted the pr/gcc-14-compiler-warning-fixes branch September 2, 2024 17:21
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.

5 participants