Skip to content

c_import: a real header's untranslated function-like macro is reported by name and reason (#582) - #2728

Merged
ehartford merged 1 commit into
fix-649from
fix-582
Oct 26, 2026
Merged

ehartford merged 1 commit into
fix-649from
fix-582

Conversation

@ehartford

@ehartford ehartford commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

A function-like macro that does not translate is recorded as an omitted
symbol so a reference to it gets the §16.2 diagnostic. The recording
went through ci_record_untranslated_macro, which records only when the
header spec itself contains #define (ci_should_report_untranslated_macros:
an inline spec), so the same macro from a real header file was a bare
"undefined variable". Object macros of the program's own headers were
already recorded always; function-like ones now are too
(ci_record_untranslated_fn_macro; a system header's stay recorded only
for an inline spec), and each carries the construct that stopped it:
token pasting, a statement expression, stringification, variadics, a
cleanup attribute, a bare NULL, a function-pointer result.

Test: test/compile_errors/err_582_real_header_token_paste_macro.w with its
header.

Refs #582

…d by name and reason (#582)

A function-like macro that does not translate is recorded as an omitted
symbol so a reference to it gets the §16.2 diagnostic. The recording
went through ci_record_untranslated_macro, which records only when the
header spec itself contains `#define` (ci_should_report_untranslated_macros:
an inline spec), so the same macro from a real header file was a bare
"undefined variable". Object macros of the program's own headers were
already recorded always; function-like ones now are too
(ci_record_untranslated_fn_macro; a system header's stay recorded only
for an inline spec), and each carries the construct that stopped it:
token pasting, a statement expression, stringification, variadics, a
cleanup attribute, a bare NULL, a function-pointer result.

Test: test/compile_errors/err_582_real_header_token_paste_macro.w with its
header.
@ehartford
ehartford added this pull request to stack #2730 October 26, 2026 01:51
@ehartford ehartford changed the title fix 582 c_import: a real header's untranslated function-like macro is reported by name and reason (#582) Oct 26, 2026
@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven battery green on the stack top 7530c39 (pinned seed nightly-20261025-local-1-c88f3eeff0bc): gate, uat and survey all green. #959 was taken out after the first battery (see its issue).

@ehartford
ehartford marked this pull request as ready for review October 26, 2026 02:19
@ehartford
ehartford merged commit 5ba83a4 into main Oct 26, 2026
@ehartford
ehartford deleted the fix-582 branch October 26, 2026 02:20
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.

1 participant