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:
Robert Allan James
2026-08-18 21:43:30 -04:00
co-authored by Claude Sonnet 5
parent 4270cf23f1
commit bf59c4916e
23 changed files with 1504 additions and 1537 deletions
+24 -24
View File
@@ -51,65 +51,65 @@
static WordTestSuite system_word_suites[] = {
{
"QUIT", {
{"basic", "QUIT", "Should reset stacks and state", TEST_NORMAL, 0, 0}, // Interactive
{"in_definition", ": BAD-WORD QUIT ;", "Should prevent compilation", TEST_ERROR_CASE, 1, 1},
{NULL, NULL, NULL, TEST_NORMAL, 0, 0}
{"basic", "QUIT", "Should reset stacks and state", TEST_NORMAL, 0, 0, {0}}, // Interactive
{"in_definition", ": BAD-WORD QUIT ;", "Should prevent compilation", TEST_ERROR_CASE, 1, 1, {0}},
{NULL, NULL, NULL, TEST_NORMAL, 0, 0, {0}}
},
2
2, {0}
},
{
"ABORT", {
{"basic", "ABORT", "Should clear stacks and return to QUIT", TEST_NORMAL, 0, 1},
{"with_data", "1 2 3 ABORT DEPTH . CR", "Should clear stack", TEST_NORMAL, 0, 1},
{"basic", "ABORT", "Should clear stacks and return to QUIT", TEST_NORMAL, 0, 1, {0}},
{"with_data", "1 2 3 ABORT DEPTH . CR", "Should clear stack", TEST_NORMAL, 0, 1, {0}},
{
"in_definition_runtime", ": BAD-WORD ABORT ; 123 BAD-WORD DEPTH . CR",
"ABORT may appear in a definition; when executed it clears both stacks", TEST_NORMAL, 0, 1
"ABORT may appear in a definition; when executed it clears both stacks", TEST_NORMAL, 0, 1, {0}
},
{NULL, NULL, NULL, TEST_NORMAL, 0, 0}
{NULL, NULL, NULL, TEST_NORMAL, 0, 0, {0}}
},
3
3, {0}
},
{
"ABORT\"", {
{
"condition_true", "-1 ABORT\" Error\"", "Should abort with message (no error; stacks cleared to QUIT)",
TEST_NORMAL, 0, 1
TEST_NORMAL, 0, 1, {0}
},
{"condition_false", "0 ABORT\" Error\"", "Should not abort", TEST_NORMAL, 0, 1},
{"empty_stack", "ABORT\"", "Should cause stack underflow", TEST_ERROR_CASE, 1, 1},
{NULL, NULL, NULL, TEST_NORMAL, 0, 0}
{"condition_false", "0 ABORT\" Error\"", "Should not abort", TEST_NORMAL, 0, 1, {0}},
{"empty_stack", "ABORT\"", "Should cause stack underflow", TEST_ERROR_CASE, 1, 1, {0}},
{NULL, NULL, NULL, TEST_NORMAL, 0, 0, {0}}
},
3
3, {0}
},
{
"BYE", {
{"basic", "BYE", "Should exit cleanly", TEST_NORMAL, 0, 0}, // Can't really test
{NULL, NULL, NULL, TEST_NORMAL, 0, 0}
{"basic", "BYE", "Should exit cleanly", TEST_NORMAL, 0, 0, {0}}, // Can't really test
{NULL, NULL, NULL, TEST_NORMAL, 0, 0, {0}}
},
1
1, {0}
},
{
"COLD", {
{"basic", "COLD", "Should reset system", TEST_NORMAL, 0, 0}, // Dangerous to test
{NULL, NULL, NULL, TEST_NORMAL, 0, 0}
{"basic", "COLD", "Should reset system", TEST_NORMAL, 0, 0, {0}}, // Dangerous to test
{NULL, NULL, NULL, TEST_NORMAL, 0, 0, {0}}
},
1
1, {0}
},
{
"WARM", {
{"basic", "WARM", "Should soft reset", TEST_NORMAL, 0, 0}, // Dangerous to test
{NULL, NULL, NULL, TEST_NORMAL, 0, 0}
{"basic", "WARM", "Should soft reset", TEST_NORMAL, 0, 0, {0}}, // Dangerous to test
{NULL, NULL, NULL, TEST_NORMAL, 0, 0, {0}}
},
1
1, {0}
},
/* End marker */
{NULL, {{NULL, NULL, NULL, TEST_NORMAL, 0, 0}}, 0}
{NULL, {{NULL, NULL, NULL, TEST_NORMAL, 0, 0, {0}}}, 0, {0}}
};
/**