Skip to content

Add -Wno-c2y-extensions to test/CMakeLists.txt#2028

Merged
ericniebler merged 4 commits intoNVIDIA:mainfrom
ispeters:suppress_c2y_extensions_warning
Apr 16, 2026
Merged

Add -Wno-c2y-extensions to test/CMakeLists.txt#2028
ericniebler merged 4 commits intoNVIDIA:mainfrom
ispeters:suppress_c2y_extensions_warning

Conversation

@ispeters
Copy link
Copy Markdown
Contributor

As of some recent commit, building the tests with Clang 22.1 fails with errors like this:

git/stdexec/test/stdexec/cpos/test_cpo_start.cpp:70:3: error: '__COUNTER__' is a
C2y extension [-Werror,-Wc2y-extensions]
   70 |   TEST_CASE("can call start on an operation state", "[cpo][cpo_start]")
      |   ^

Adding -Wno-c2y-extensions (or variations, like -Wno-pedantic) to the -DCMAKE_CXX_FLAGS config-time parameters doesn't seems to help; the flags added there end up before -Wpedantic in the compiler command line, and, possibly because of llvm/llvm-project#184250, Clang doesn't override -Wpedantic with an earlier-supplied suppression.

This diff just adds the required warning in the required place in the hard-coded compiler warning flags to suppress the warning for everyone.

As of some recent commit, building the tests with Clang 22.1 fails with
errors like this:
```
git/stdexec/test/stdexec/cpos/test_cpo_start.cpp:70:3: error: '__COUNTER__' is a
C2y extension [-Werror,-Wc2y-extensions]
   70 |   TEST_CASE("can call start on an operation state", "[cpo][cpo_start]")
      |   ^
```

Adding `-Wno-c2y-extensions` (or variations, like `-Wno-pedantic`) to
the `-DCMAKE_CXX_FLAGS` config-time parameters doesn't seems to help;
the flags added there end up *before* `-Wpedantic` in the compiler
command line, and, possibly because of llvm/llvm-project#184250, Clang
doesn't override `-Wpedantic` with an earlier-supplied suppression.

This diff just adds the required warning in the required place in the
hard-coded compiler warning flags to suppress the warning for everyone.

(llvm/llvm-project#184250)
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 16, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test 2cfc4d2

@ispeters
Copy link
Copy Markdown
Contributor Author

That is a disappointing number of build failures.

Make the new warning suppression flag conditional on its availability
and add Clang 22 to the CI matrix (debug builds only) to validate this
change works in CI, too.
@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test 7185e64

Comment thread test/CMakeLists.txt Outdated
@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test 64999ed

Comment thread .github/workflows/ci.cpu.yml Outdated
My attempt to add Clang 22 builds to the CI matrix needs fixing; let's do that in another PR.
@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test c7199d7

@ericniebler ericniebler merged commit 578ea7b into NVIDIA:main Apr 16, 2026
30 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