fix(tests): use -pedantic-errors instead of a Clang-only warning name - #228
Merged
Merged
Conversation
-Werror=implicitly-unsigned-literal is a Clang spelling; GCC has no
warning by that name and rejects it as an unknown option, aborting the
compile before it ever reaches the unsuffixed-literal check this test
exists to enforce. That has been failing 7 tests in this file on every
Linux CI run (including the last two development->main release merges,
v0.6.3 and v0.6.4) since the test predates this branch.
-pedantic-errors turns the same GCC diagnostic ("integer constant is so
large that it is unsigned") into a hard error and works on Clang too.
Verified in a Node 22 + GCC 13.3.0 / Ubuntu 24.04 container matching
the CI runner: the target test (7/7), the full suite (93 files, 2322
passed, 7 skipped, coverage gate green), lint and typecheck all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PQ239CtwGVnDMSeLA2Lx93
thiagoralves
approved these changes
Aug 31, 2026
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's broken
tests/integration/integer-literal-exact-cpp.test.tscompiles generated C++ with-Werror=implicitly-unsigned-literal, a Clang-only warning name. On real GCC (the Linux CI runner),g++doesn't recognize it and aborts outright:That fails all 7 tests in the file — not because the code under test is wrong, but because the compile never gets far enough to check it. It passes on macOS dev machines because
g++there is Apple Clang.This isn't new: the same 7 tests failed identically on Linux CI for the last two
development→mainrelease merges (v0.6.3, v0.6.4) — both shipped anyway. Discovered while opening #227 (development → main for v0.6.5), which is currently red because of it.The fix
Swap the Clang-only flag for
-pedantic-errors. GCC's diagnostic for this case ("integer constant is so large that it is unsigned") has no-Wname of its own — it's unconditional — so it can't be targeted with a named-Werror=.-pedantic-errorsis the portable way to turn it into a hard error on both compilers.Verification
Ran in a Node 22 + GCC 13.3.0 / Ubuntu 24.04 container matching the CI runner exactly (confirmed via the failing run's own "Operating System" log):
integer-literal-exact-cpp.test.ts: 7/7 passing (was 0/7).npm run lint: 0 errors.npm run typecheck: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01PQ239CtwGVnDMSeLA2Lx93