The argv-error diagnostics in w6c/main.ww (7 sites) and w6l/main.ww (13 literal sites) passed hand-counted byte lengths to os.write that were systematically short by one — every length dropped the final byte (usually '\n'; "w6l: cannot find -l" dropped the 'l'), so the diagnostics printed truncated. Replace each magic length with the string's own .len, which both fixes the off-by-one and closes the hand-count class by construction. Uses the local-binding idiom (let m: str = "..."; os.write(2, m.ptr, m.len: u64);) — the established wcc/err.ww pattern — rather than "literal".len directly: string-literal .len is miscompiled on cstage (returns the pointer, not the length; cstage != wwstage), filed as #14. str-variable .len is correct on both stages, so this is byte- identical cs==ww and independent of #14. The w6l runtime cstr write (os.write(2, nm, cstrlen(nm))) is unchanged.
4.4 KiB
4.4 KiB