Skip to content

A block-scope extern with no file-scope declaration is the variable's declaration: the STC corpus migrates again (#3231); with migrate takes a directory the file system says is one - #3346

Merged
ehartford merged 2 commits into
mainfrom
block-extern
Nov 15, 2026

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Nightly #3231, stc-drift-report. STC declares extern const uint8_t cutf8_dtab[]; inside an inline function; the table is defined in another unit. Since #3244 the migrator refused that function ("names a variable no file-scope declaration in this translation unit gives a type") and migrate failed the corpus. C11 6.2.2p4: the block declaration declares the file-scope object, so where the unit has no file-scope declaration it is the variable's declaration. ClangBridge.collect_block_scope_externs appends it to the declaration list, once per name; everything downstream treats it as it treats a file-scope extern. src/main build :stc-drift-report is green (13/13 files), reproduced red on main first.

with migrate <dir>. A directory was recognised by its spelling (no .c/.h ending and more than two characters), so with migrate c -o w said "cannot read c". It is a directory when the file system says so.

Test: behav_migrate_block_scope_extern_declares_the_variable (two units, the table defined in the other; a relative two-letter-free directory c). Fails on the installed compiler, passes here.

Battery: GREEN on d6973b6.

Still open on #3231: five internals-tests time out on the CI runner. Filed on the way: #3344.

Eric Hartford added 2 commits November 14, 2026 21:09
…e variable's declaration (C11 6.2.2p4): the STC corpus migrates again (#3231)
… one- or two-letter directory was 'cannot read c'); test for the block-scope extern
@ehartford
ehartford merged commit c36ce8b into main Nov 15, 2026
@ehartford
ehartford deleted the block-extern branch November 15, 2026 03:31
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