~400k LOC of pre-2021 C++ built by three different toolchains. No -Wall/-Wextra baseline exists; warnings are unknown/untracked. The new CI should not fail on warnings yet (-Werror is premature), but the signal must be visible and shrinking.
What to do
Add -Wall -Wextra (GCC/Clang) to the CMake build (option or default), produce a categorized count (by warning type × file).
Fix the cheap, high-signal classes first (missing includes are already tracked separately; then things like -Wclass-memaccess, sign-compare in engine-adjacent code, unused variables in extras/).
Track the count in CI (print a summary line per build; optionally a workflow step that fails only if the count GROWS vs. a committed baseline number).
Only once the count is near-zero on both branches, propose -Werror for CI.
Acceptance
Warning count visible in every CI run.
Monotonically decreasing across the milestone; baseline number committed to the repo.
No behavior changes: warning fixes must not alter game logic (prefer casts/guards that are provably no-ops).
## Context
~400k LOC of pre-2021 C++ built by three different toolchains. No `-Wall`/`-Wextra` baseline exists; warnings are unknown/untracked. The new CI should not fail on warnings yet (`-Werror` is premature), but the signal must be visible and shrinking.
## What to do
1. Add `-Wall -Wextra` (GCC/Clang) to the CMake build (option or default), produce a categorized count (by warning type × file).
2. Fix the cheap, high-signal classes first (missing includes are already tracked separately; then things like `-Wclass-memaccess`, sign-compare in engine-adjacent code, unused variables in `extras/`).
3. Track the count in CI (print a summary line per build; optionally a workflow step that fails only if the count GROWS vs. a committed baseline number).
4. Only once the count is near-zero on both branches, propose `-Werror` for CI.
## Acceptance
- Warning count visible in every CI run.
- Monotonically decreasing across the milestone; baseline number committed to the repo.
- No behavior changes: warning fixes must not alter game logic (prefer casts/guards that are provably no-ops).
opencode
added this to the M4: Toolchain & language modernization milestone 2026-11-29 00:14:32 +00:00
Suggested first milestones: (1) fix all maybe-uninitialized; (2) burn down the Script*.cpp cluster; (3) decide whether -Wpedantic noise (anonymous structs — a deliberate R* idiom) gets suppressed project-wide rather than fixed.
**Measured baseline (GCC 13.3, RelWithDebInfo, master @ 5c86592e):**
- **10,878 warnings** + 510 notes: 6,723 in `src/`, 4,152 in `vendor/librw`; 28 distinct `-W` flags active.
Top flags: `unused-parameter` 5224 · `pedantic` 1950 · `unknown-pragmas` 895 · `strict-aliasing` 786 · `parentheses` 463 · `ignored-qualifiers` 444 · `sign-compare` 241 · `double-promotion` 157 · **`maybe-uninitialized` 134** · `stringop-truncation` 50 · `deprecated-copy` 37 · `class-memaccess` 34.
Highest-risk class: `-Wmaybe-uninitialized` (134) — real-bug-adjacent. Biggest single cluster: the `src/control/Script*.cpp` family (Script4 203, Script3 196, Script2 129, Script5 108, Script 98, Script6 89 ≈ 823 total). Headers dominate per-location counts (`vendor/librw/src/rwbase.h` 2008, `src/core/common.h` 1790, `src/vehicles/Vehicle.h` 1472).
Suggested first milestones: (1) fix all `maybe-uninitialized`; (2) burn down the Script*.cpp cluster; (3) decide whether `-Wpedantic` noise (anonymous structs — a deliberate R* idiom) gets suppressed project-wide rather than fixed.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
~400k LOC of pre-2021 C++ built by three different toolchains. No
-Wall/-Wextrabaseline exists; warnings are unknown/untracked. The new CI should not fail on warnings yet (-Werroris premature), but the signal must be visible and shrinking.What to do
-Wall -Wextra(GCC/Clang) to the CMake build (option or default), produce a categorized count (by warning type × file).-Wclass-memaccess, sign-compare in engine-adjacent code, unused variables inextras/).-Werrorfor CI.Acceptance
Measured baseline (GCC 13.3, RelWithDebInfo, master @ 5c86592e):
src/, 4,152 invendor/librw; 28 distinct-Wflags active.Top flags:
unused-parameter5224 ·pedantic1950 ·unknown-pragmas895 ·strict-aliasing786 ·parentheses463 ·ignored-qualifiers444 ·sign-compare241 ·double-promotion157 ·maybe-uninitialized134 ·stringop-truncation50 ·deprecated-copy37 ·class-memaccess34.Highest-risk class:
-Wmaybe-uninitialized(134) — real-bug-adjacent. Biggest single cluster: thesrc/control/Script*.cppfamily (Script4 203, Script3 196, Script2 129, Script5 108, Script 98, Script6 89 ≈ 823 total). Headers dominate per-location counts (vendor/librw/src/rwbase.h2008,src/core/common.h1790,src/vehicles/Vehicle.h1472).Suggested first milestones: (1) fix all
maybe-uninitialized; (2) burn down the Script*.cpp cluster; (3) decide whether-Wpedanticnoise (anonymous structs — a deliberate R* idiom) gets suppressed project-wide rather than fixed.