Zero C-compiler warnings on all three architectures; fix real restore_vm_state() bug
Maintainability sweep (prompted by "this is getting hard to maintain"): fixed the remaining three warning classes after the missing-field- initializers commit -- 2x -Wsign-compare (control_words.c, cast at the comparison site rather than changing cf_last_mode's type, which deliberately holds a -999 sentinel outside vm_mode_t's valid range), 2x -Wstringop-truncation (mkcapsule.c, strncpy+manual-null-terminate replaced with the idiomatic snprintf equivalent), and 26x -Wunused-parameter (mostly documented stubs, silenced with the repo's existing (void)param; idiom). One of the unused-parameter warnings was not a deliberate stub -- a real bug. restore_vm_state() (test_common.c) is named, documented, and called by nine real call sites (acl_words_test.c x8 plus its own internal use) as "restore saved VM state", but ignored all four of its parameters and hard-reset to a fixed baseline instead, silently not restoring what any caller actually saved. Fixed to actually assign the passed-in dsp/rsp/error/mode. Found while fixing warnings, reported before touching it, fixed/tested/documented/committed on explicit instruction. Verified: all three architectures build with zero C-compiler warnings (amd64: 3040 -> 0; aarch64's one remaining note is lld-link's own unrelated linker warning, not a C warning). Full amd64 acceptance boot post-fix: POST 1003/965/0/0/38 (total/passed/failed/errors/stubs), "ALL IMPLEMENTED TESTS PASSED!", contract checks (A4'/A1) all passed, dict_hash=0x24b4279f0670aa3a -- an exact match to this document's own previously-recorded baseline hash. .claude/CLAUDE.md corrected to describe the real -Wno-error= exemption list instead of the "-Wall -Werror" oversimplification. FABRIC-2.md Section J records the full sweep, including doc-tree staleness findings flagged but not fixed this pass (docs/lithosananke/ROADMAP.md branch topology, docs/03-architecture/word-acl/DESIGN.md's Phase 7 claim contradicting CLAUDE.md, top-level ROADMAP.md's stale StarForth-era status, the Isabelle pipeline-metrics model mismatch). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
bf59c4916e
commit
1a2ec565e8
@@ -124,7 +124,7 @@ static inline void cf_epoch_sync(VM *vm) {
|
||||
cf_last_mode = vm->mode;
|
||||
return;
|
||||
}
|
||||
if (vm->mode != cf_last_mode) {
|
||||
if ((int)vm->mode != cf_last_mode) {
|
||||
cf_sp = -1;
|
||||
cf_last_mode = vm->mode;
|
||||
log_message(LOG_DEBUG, "CF: reset (mode transition)");
|
||||
|
||||
@@ -71,6 +71,7 @@ static void io_word_emit(VM *vm) {
|
||||
* Outputs a newline character to the terminal
|
||||
*/
|
||||
static void io_word_cr(VM *vm) {
|
||||
(void)vm;
|
||||
putchar('\n');
|
||||
fflush(stdout);
|
||||
}
|
||||
@@ -146,6 +147,7 @@ static void io_word_type(VM *vm) {
|
||||
* Outputs a single space character to terminal
|
||||
*/
|
||||
static void io_word_space(VM *vm) {
|
||||
(void)vm;
|
||||
putchar(' ');
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
@@ -334,6 +334,7 @@ void string_word_bracket_tick(VM *vm) {
|
||||
|
||||
/* LITERAL / [LITERAL] are placeholders here */
|
||||
void string_word_literal(VM *vm) {
|
||||
(void)vm;
|
||||
}
|
||||
|
||||
void string_word_bracket_literal(VM *vm) { string_word_literal(vm); }
|
||||
|
||||
Reference in New Issue
Block a user