Fix systemic -Wmissing-field-initializers across src/test_runner/modules/ (3010 -> 0)
TestCase gained a trailing `contract` field (WordContract) at some point
after all 20 test-module files' compound literals were written -- every
single TestCase/WordTestSuite initializer in the tree (sentinels, real
entries, and per-suite entries) omitted it, producing ~3010 warnings on
every build. CLAUDE.md's own documentation claimed this was isolated to
one file (vocabulary_words_test.c); a full audit found it systemic
across all 20 files.
Fixed mechanically: added the missing `{0}` trailing initializer
everywhere. Semantically a no-op -- C99 already zero-fills unlisted
trailing struct fields, so this only silences the diagnostic, changes
no behavior. Verified: all three architectures (amd64/aarch64/riscv64)
build clean, remaining warning count unchanged (30, matching the other
three known -Wno-error-exempted classes: unused-parameter, sign-compare,
plus mkcapsule.c's stringop-truncation which was never actually gated
by this policy -- it's a separate host tool with no -Werror at all).
.claude/CLAUDE.md corrected to describe the actual -Wno-error= exemption
list (four classes, not "build with -Wall -Werror" unconditionally) and
the real current warning inventory.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
4270cf23f1
commit
bf59c4916e
+17
-3
@@ -446,9 +446,23 @@ status for kernel work.
|
||||
## Code Standards
|
||||
|
||||
- **Strict ANSI C99** — No GNU extensions, no C++ features
|
||||
- **Zero warnings target** — Build with `-Wall -Werror`; note `-Wmissing-field-initializers`
|
||||
warnings have been observed in `src/test_runner/modules/vocabulary_words_test.c` during a
|
||||
full kernel build — worth reporting if it recurs, not silently patched
|
||||
- **Zero warnings target, with four explicit exceptions — corrected 2026-08-18, previous
|
||||
claim was wrong.** Build with `-Wall -Wextra -Werror`, but `Makefile.starkernel` carries
|
||||
`-Wno-error=unused-parameter -Wno-error=shift-negative-value -Wno-error=sign-compare
|
||||
-Wno-error=missing-field-initializers` — those four classes are enabled (still visible as
|
||||
warnings) but deliberately downgraded from fatal, everything else is. The previous version
|
||||
of this line claimed `-Wmissing-field-initializers` was isolated to one file
|
||||
(`vocabulary_words_test.c`) — that was never accurate; a full audit found it systemic
|
||||
across 20 files in `src/test_runner/modules/` (all missing the same later-added
|
||||
`TestCase.contract`/`WordTestSuite.suite_contract` trailing field, ~3,010 instances). Fixed
|
||||
in place across all 20 files (mechanical: added the missing `{0}` initializer, semantically
|
||||
a no-op since C99 already zero-fills unlisted trailing fields — the fix only silences the
|
||||
diagnostic). Verified clean on all three architectures. Remaining, still-open warnings as
|
||||
of the same audit: 26 `-Wunused-parameter` (scattered, several files, not yet fixed), 2
|
||||
`-Wsign-compare` (`control_words_test.c:127`), and 2 `-Wstringop-truncation` in
|
||||
`tools/mkcapsule.c` — that last one is a separate host build tool compiled via plain `cc
|
||||
-Wall -Wextra -O2` (no `-Werror` at all), never actually gated by this policy in the first
|
||||
place, genuinely unfixed rather than exempted.
|
||||
- **No hidden state** — All VM state is explicit in the `VM` struct
|
||||
- **Platform-agnostic** — Kernel code gated by `__STARKERNEL__` and `STARFORTH_ENABLE_VM`
|
||||
- **Content-addressed immutability** — Capsule ID = content hash; any mutation is detectable
|
||||
|
||||
Reference in New Issue
Block a user