Skip to content

coll/csel: fix clang/icx build; fix clang testsuite warnings - #8127

Merged
hzhou merged 4 commits into
pmodels:mainfrom
hzhou-muse:csel-default-decl
Nov 9, 2026
Merged

hzhou merged 4 commits into
pmodels:mainfrom
hzhou-muse:csel-default-decl

Conversation

@hzhou-muse

@hzhou-muse hzhou-muse commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Description

Since 5de2fd2, validate_defined_conditions in csel_validation.c declares const char *cond_name; directly after a default: label. Before C23 that is not valid C, so clang and Intel oneAPI reject it (error: expected expression). All clang and intel-oneapi cells of mpich-main-ch4-ucx fail to build (e.g. builds 1244 and 1248).

This PR wraps the default case in a block, so the declaration is local to it.

It also fixes the warnings clang reports when building the testsuite:

  • mpi_t/mpit_test2: assert(count = 1) assigned instead of comparing
  • threadcomm tests: thread functions fell off the end without a return
  • datatype/struct_{pack,unpack}_mpi_bottom: switch in memtype_str had no default case

Author Checklist

  • Provide Description
  • Commits Follow Good Practice
  • Passes All Tests
  • Contribution Agreement

Model: Claude Opus 5.5

Wrap the default case in validate_defined_conditions in a block, so
cond_name is declared inside it rather than directly after the label.
Previously the declaration followed the default: label, which is not
valid before C23 and broke the clang and Intel oneAPI builds.

Model: Claude Opus 5.5
@hzhou-muse

Copy link
Copy Markdown
Contributor Author

test:mpich/custom
compiler: clang

Check the count returned by MPI_T_pvar_handle_alloc with ==.
Previously the asserts assigned 1 to count, so they always passed, and
clang warned about it.

Model: Claude Opus 5.5
End test_thread in the threadcomm tests with a return, as the other
thread tests do. Previously they fell off the end of a non-void
function, which clang warns about.

Model: Claude Opus 5.5
Let the memtype_str switch in struct_{pack,unpack}_mpi_bottom fall
through to the numeric format with a default case. Previously clang
warned that the remaining memory types were not handled in the switch.

Model: Claude Opus 5.5
@hzhou-muse hzhou-muse changed the title coll/csel: fix clang/icx build of csel_validation.c coll/csel: fix clang/icx build; fix clang testsuite warnings Nov 9, 2026
@hzhou-muse

Copy link
Copy Markdown
Contributor Author

test:mpich/custom
compiler: clang

@hzhou
hzhou merged commit f171950 into pmodels:main Nov 9, 2026
7 of 8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants