Skip to content

Recover bounded C-family signature macros - #253

Merged
tob-scott-a merged 1 commit into
mainfrom
codex/v010-signature-macros
Dec 2, 2026
Merged

tob-scott-a merged 1 commit into
mainfrom
codex/v010-signature-macros

Conversation

@tob-scott-a

@tob-scott-a tob-scott-a commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Recover bounded object-like function signature macros in C, C++, and Objective-C. Recovered declarations retain their expanded names, parameters, return types, physical locations, and signature provenance; expanded callback parameters continue to shadow globals. This restores entrypoint detection for macro-defined main functions.

Definitions must be unique, unconditional, and before their use. C can inspect literal in-root headers; C++ and Objective-C use same-file definitions. Expansion and parsing have explicit byte, alias, and nesting bounds. Original syntax diagnostics remain visible, and strict mode still rejects recovered source. Definitions whose earlier syntax lost context remain unresolved, including through aliases and C headers.

Validation: 7,230 tests passed with one Python-version skip; Ruff, formatting, and ty passed. The focused mutation campaign killed every mutant in the signature module and the reviewed macro helpers. Negative controls, exact expansion/include budgets, native type boundaries, original-range composition, and real-process parsing are covered. A deterministic work-bound test kills disabling the C++ body query. One private C default has a narrow equivalence review: ordinary callers supply it explicitly, and recovered callers cannot use it.

Closes #226.

@tob-scott-a
tob-scott-a force-pushed the codex/v010-signature-macros branch from d58444a to 853621b Compare December 2, 2026 11:21
@tob-scott-a
tob-scott-a merged commit f93c78d into main Dec 2, 2026
57 checks passed
@tob-scott-a
tob-scott-a deleted the codex/v010-signature-macros branch December 2, 2026 12:57
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.

C/C++: function whose signature comes from a macro is lost (e.g. a macro-defined main)

1 participant