Skip to content

fix(gen-c): *T parameters reach C as T* - #2930

Merged
gHashTag merged 3 commits into
masterfrom
w762
Aug 30, 2026
Merged

fix(gen-c): *T parameters reach C as T*#2930
gHashTag merged 3 commits into
masterfrom
w762

Conversation

@gHashTag

Copy link
Copy Markdown
Owner
uint64_t set(*Bitmap bitmap);
error: type specifier missing, defaults to 'int'
error: expected ')'

param_type_to_c has arms for ?T, []T, []const T, [T; N] and [N]T
and had none for the prefix star. In C the * belongs to the declarator; written
first, Bitmap parses as the declared name with an implicit-int type.

52 of 578 generated headers carried it.

What it does and does not move

before after
files with (*Type name 52 0
cc accepts 174 174

Zero on the headline, and that is the measurement rather than a disappointment:
of 404 rejected files only 20 are blocked by a single error family, and the
median carries four or five. No one family is a lever in this backlog (#2925).

What it moves is what comes next:

error: member reference type 'Bitmap *' is a pointer; did you mean to use '->'?

now its own single-family file — invisible while the parameter never parsed.

Mutation-checked

mutation test that fails
star prepended to raw text, no recursion the_star_arm_recurses_rather_than_prepending_to_raw_text (*[]u8 gave []u8*, not uint8_t**)

Closes #2929

    uint64_t set(*Bitmap bitmap);
    error: type specifier missing, defaults to 'int'
    error: expected ')'

`param_type_to_c` has arms for `?T`, `[]T`, `[]const T`, `[T; N]` and `[N]T`,
and had none for the prefix star, so the t27 text passed through verbatim. In C
the star belongs to the declarator: written first, `Bitmap` parses as the
declared NAME carrying an implicit-int type, and the second identifier is then
unexpected. 52 of 578 generated headers carried it.

    files with `(*Type name`     52 -> 0
    cc accepts                  174 -> 174

The headline does not move, and that is the measurement rather than a
disappointment: of 404 rejected files only 20 are blocked by a single error
family and the median carries four or five, so no one family is a lever here.

What it moves is what comes next. With pointers typed correctly,

    error: member reference type 'Bitmap *' is a pointer; did you mean to use '->'?

becomes its own single-family file -- invisible while the parameter never parsed.

The arm recurses rather than prepending to raw text: `*[]u8` is `uint8_t**`,
and the mutation that skips the recursion emits `[]u8*`.

Closes #2929
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag enabled auto-merge (squash) August 30, 2026 00:24
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 00:24:54 UTC

Summary

Status Count
Total Open PRs 10
PRs with Failing Checks 7
PRs with All Checks Green 3
READY 2
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=f54e190f098b != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 00:26:23 UTC

Summary

Status Count
Total Open PRs 10
PRs with Failing Checks 7
PRs with All Checks Green 3
READY 1
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=f54e190f098b != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 00:28:10 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 7
PRs with All Checks Green 2
READY 1
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=f54e190f098b != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit d6c5cfa into master Aug 30, 2026
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

param_type_to_c has no arm for *T, so 52 headers carry void set(*Bitmap bitmap)

1 participant