fix(gen-c): [T;N] param types, test-block bindings, two-arg assert macro - #1920
Merged
Conversation
Applying the Zig-campaign methodology to the C backend (gcc -fsyntax-only over tri-net's 68 legacy specs): Rust-style [T; N] parameter types lower to T* (previously a bare '* name'); test-block bindings are declared on first assignment (the C twin of #1894), with tuple targets bound once via GNU __auto_type and peeled .f0/.f1; and t27's two-argument assert(cond, "msg") lowers to a self-contained t27_assert macro with the message re-quoted -- bare unquoted words previously hit C's one-argument assert macro and even leaked non-ASCII message text into identifiers. Sweep: 64/68 -> 8/68 invalid; the eight remaining one-offs are enumerated in the issue. Unit suite 1537/1537; FROZEN_HASH resealed. Refs #1919 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
August 8, 2026 07:55
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applying the Zig-campaign methodology to the C backend (
gcc -fsyntax-onlyover tri-net's 68 legacy specs), three systematic fixes take validity from 64/68 invalid to 8/68:[T; N]parameter types lower toT*-- previously the element type was read from AFTER the](Zig-style), emitting a bare* name.uint64_t b0 = ...;-- the C twin of the Verilog gen-verilog-sim: test-block local bindings emitted as assignments without reg declarations #1894 / Zig defects); tuple targets bind the struct return once via GNU__auto_type(gcc + clang) and peel.f0/.f1.assert(cond, "msg")lowers to a self-containedt27_assertmacro with the message literal RE-QUOTED -- bare unquoted words previously hit C's one-argument assert macro and even leaked non-ASCII message text into identifier position.The eight remaining failures are distinct one-offs enumerated in #1919 (array-returning fns,
_redefinition, scalar-from-tuple binding, two call-site arity mismatches that look like genuine spec bugs, an oversized literal, one parse error). Unit suite 1537/1537 (== master); other backends untouched; FROZEN_HASH resealed; NOW.md + docs/NOW.md updated.Refs #1919
🤖 Generated with Claude Code