Fix GCC builds by gating Clang-only warning suppressions - #227
Merged
Conversation
The Debug-only warning suppression list contains Clang-specific flags. GCC recognizes -Wno-missing-prototypes and -Wno-missing-variable-declarations but rejects them in C++ mode: cc1plus: error: command-line option '-Wno-missing-prototypes' is valid for C/ObjC but not for C++ [-Werror] This was previously harmless because the same list ended in -Wno-error. Making warnings-as-errors opt-in (#220) dropped that -Wno-error and added -DPEPARSE_WARNINGS_AS_ERRORS=ON to CI, so the diagnostic became fatal and every Linux GCC job failed. Matrix fail-fast then cancelled the Clang and macOS jobs, which made the failure look far broader than it was. CI has been red since 2026-06-19 as a result. Only apply the suppressions when the compiler is Clang. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
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.
What this fixes
CI has been red on every
pe-parsejob since 2026-06-19.The Debug-only warning-suppression list in
cmake/compilation_flags.cmakeholds Clang-specific flags. GCC recognizes-Wno-missing-prototypesand-Wno-missing-variable-declarationsbut rejects them in C++ mode:That list used to end in
-Wno-error, which neutralized-Werrorin Debug builds and kept the diagnostic harmless. #220 removed that-Wno-errorand added-DPEPARSE_WARNINGS_AS_ERRORS=ONto CI, so it became fatal and every Linux GCC build failed.This PR applies those suppressions only when the compiler is Clang (the check also matches AppleClang).
The failures looked broader than they were
There is one bug here, not nine. The GCC Debug job fails during compilation in ~17s, and matrix
fail-fastthen cancelled every Clang and macOS job before they got pastcmake. Those jobs are allcancelled, notfailure— none had an independent error.Two follow-ups worth considering separately:
fail-fast: falseto thepe-parsematrix would have made this diagnosable at a glance instead of hiding 9 jobs behind one failure.-Werrornewly effective in Debug builds on all platforms. The macOS legs never completed a build during the red period, so this PR's CI run is the first real signal for them.Testing
Ran the Linux half of the CI matrix locally — gcc 15.2 and clang 21.1, Debug/Release, shared/static, ASan+UBSan on Debug,
PEPARSE_WARNINGS_AS_ERRORS=ON, tests and examples enabled.All 8 configurations build clean, 15/15 ctest pass, and
dump-peruns ontests/assets/example.exe. Also confirmed the suppressions still reach Clang Debug builds and are absent from GCC Debug builds. The change is CMake-only, so thelintjob is unaffected.🤖 Generated with Claude Code