You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable -Wall -Wextra -Werror: first-party baseline + gate generated code (compile_check_driver), with a cross-repo golden-compile follow-up #89
The project currently enforces no warning flags — no -Wall/-Wextra/-Werror in CMakeLists.txt, tests/CMakeLists.txt, or the CI workflow (.github/workflows/build.yml runs a bare cmake -B build -DCMAKE_BUILD_TYPE=...). Two PR #88 review rounds surfaced warnings in generated code (-Wunused-variable on a state-independent rate's <state> local; clang -Wunused-private-field on an unreferenced m_<param>) that would break a downstream -Werror build. Those were fixed with [[maybe_unused]], but nothing guards against a regression — because codegen never compiles the affected output under a warning gate.
Proposal (three parts, increasing cost)
1. First-party warning baseline (cheap, do first)
Add -Wall -Wextra -Wpedantic to the first-party targets (numsim_codegen + numsim_codegen_tests), and -Werror in CI. Scope it to first-party only — fetched deps (numsim-cas, tmech, Eigen, gtest) must stay SYSTEM/-isystem so their header warnings don't trip -Werror (CAS is already SYSTEM YES; verify tmech/Eigen are -isystem). This catches warnings in codegen's own source. Note: it does not catch generated-code warnings.
2. Gate the GENERATED standalone code (the high-value part)
compile_check_driver already compiles codegen-generated standalone headers (CompileCheck, PiecewiseCheck, …) in-repo. Add -Wall -Wextra -Werror to that target so generated standalone code is warning-clean as a CI invariant. This directly regression-guards the PR #88[[maybe_unused]] fixes for the standalone path — the single most valuable addition, and it needs no extra toolchain.
3. Gate the generated numsim-materials material (cross-repo follow-up)
The NumSimMaterialTarget output can't be compiled in this repo (it needs the numsim-materials headers + g++-14, since numsim-materials uses <print>). Warning-gating it requires the cross-repo golden-compile CI job (compile a generated material against a pinned numsim-materials SHA with -Wall -Wextra -Werror) — see the separate CI-gate follow-up. Until that exists, the round-3 [[maybe_unused]] fixes are only guarded by manual cross-repo spikes.
Caveats
Scope -Werror to first-party. Deps' headers warn under -Wextra; keep them SYSTEM.
Validate across the matrix (gcc-14 + clang-18) — they diverge (e.g. -Wunused-private-field is clang-only). A warning clean on one may fail the other.
Prefer -Werror in CI, plain -Wall -Wextra locally (e.g. option(NUMSIM_CODEGEN_WERROR ...) defaulting OFF, ON in CI), so a newer local compiler's novel warnings don't block day-to-day builds.
Acceptance
First-party targets build clean under -Wall -Wextra on both matrix compilers; -Werror enforced in CI.
compile_check_driver compiles all generated standalone headers under -Wall -Wextra -Werror.
Cross-repo golden-compile gate tracked separately for the numsim-materials target.
All three gates are already in place and CI-enforced — closing as complete.
First-party baseline — cmake/warnings.cmake defines numsim_codegen_warnings (-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion + more), with -Werror under $<CONFIG:Debug> or NUMSIM_CODEGEN_WERROR=ON. Linked PRIVATE into the library, tests, and generators; deps stay SYSTEM.
Generated standalone code — numsim_codegen_warnings_light (-Wall -Wextra + the same -Werror gate) is linked into compile_check_driver (and the spectral / hencky / fpsvk / svk generated-header drivers), so generated standalone headers compile warning-clean in CI.
Cross-repo numsim-materials material — .github/workflows/build.yml builds Debug (→ -Werror on) with NUMSIM_CODEGEN_FETCH_MATERIALS=ON, and numsim_material_check_driver is linked with warnings_light — so the generated NumSimMaterialTarget output compiles against real numsim-materials under -Werror in CI.
Matrix is gcc-14 + clang-19, Debug + Release. Nothing left to implement.
Activity
petlenz commentedon Jul 29, 2026
All three gates are already in place and CI-enforced — closing as complete.
cmake/warnings.cmakedefinesnumsim_codegen_warnings(-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion+ more), with-Werrorunder$<CONFIG:Debug>orNUMSIM_CODEGEN_WERROR=ON. Linked PRIVATE into the library, tests, and generators; deps stay SYSTEM.numsim_codegen_warnings_light(-Wall -Wextra+ the same-Werrorgate) is linked intocompile_check_driver(and the spectral / hencky / fpsvk / svk generated-header drivers), so generated standalone headers compile warning-clean in CI..github/workflows/build.ymlbuilds Debug (→-Werroron) withNUMSIM_CODEGEN_FETCH_MATERIALS=ON, andnumsim_material_check_driveris linked withwarnings_light— so the generated NumSimMaterialTarget output compiles against real numsim-materials under-Werrorin CI.Matrix is gcc-14 + clang-19, Debug + Release. Nothing left to implement.