-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Clang 16 -> 17 migration path for -pedantic -Wno-gnu-empty-initializer #64357
Comments
I'll also note: If the solution is "do |
5d8aaad removed |
I think it's reasonable to leave |
While working on this, I realized there's at least two ways to view this: add the warning group back in and let it control diagnostic behavior or add the warning group back in and silently accept it without changing diagnostic behavior. I think the latter makes the most sense to me -- this used to be a GNU extension, but the feature was added to C2x so now it's a C extension rather than a GNU extension. Would you be fine if the behavior was to silently eat use of the warning group? e.g.,
This would allow you to do |
Yes, that sounds perfectly fine to me here. |
/cherry-pick 151214b |
/branch llvm/llvm-project-release-prs/issue64357 |
llvm/llvm-project@5d8aaad removed the warning group as the functionality is no longer a GNU extension. However, users have asked for the warning group to be supported so that code transitioning from Clang 16 to Clang 17 has an easier migration path when compiling with -Werror. This patch restores the warning group, but as an ignored warning group because the functionality is now always considered to be a C extension rather than a GNU extension. This allows users to do: -Werror -pedantic -Wno-gnu-empty-intializer -Wno-c2x-extensions to silence the diagnostics in both Clang 16 and Clang 17. Fixes llvm/llvm-project#64357 Differential Revision: https://reviews.llvm.org/D157503 (cherry picked from commit 151214b)
/pull-request llvm/llvm-project-release-prs#566 |
llvm/llvm-project@5d8aaad removed the warning group as the functionality is no longer a GNU extension. However, users have asked for the warning group to be supported so that code transitioning from Clang 16 to Clang 17 has an easier migration path when compiling with -Werror. This patch restores the warning group, but as an ignored warning group because the functionality is now always considered to be a C extension rather than a GNU extension. This allows users to do: -Werror -pedantic -Wno-gnu-empty-intializer -Wno-c2x-extensions to silence the diagnostics in both Clang 16 and Clang 17. Fixes llvm/llvm-project#64357 Differential Revision: https://reviews.llvm.org/D157503 (cherry picked from commit 151214b)
We have a user building with
-pedantic
who has-Wno-gnu-empty-initializer
set on their codebase.Preflighting Clang 17 adoption, their code is failing because
-Wno-gnu-empty-initializer
no longer exists.That's now covered under
-Wno-c2x-extensions
but this doesn't suppress that warning on Clang 16.You can't use both flags, because
-Wno-gnu-empty-intializer
is no longer a flag in Clang 17, which means there is no combination of flags that lets you suppress this warning across adjacent clang versions.Can we re-add this warning flag to leave a migration path that lets them continue to build with two adjacent clang versions?
Reproducer to check against:
-Werror -pedantic -Wno-gnu-empty-intializer
- OK-Werror -pedantic -Wno-c2x-extensions
- OK-Werror -pedantic -Wno-c2x-extensions
- does not suppress the diagnostic, fails with-Wgnu-empty-intializer
.-Werror -pedantic -Wno-gnu-empty-intializer
- fails with-Wunknown-warning-option
The text was updated successfully, but these errors were encountered: