Skip to content

fix incorrect processing of register and auto storage-classes#119

Open
bust6k wants to merge 1 commit intorui314:masterfrom
bust6k:fix-register-auto
Open

fix incorrect processing of register and auto storage-classes#119
bust6k wants to merge 1 commit intorui314:masterfrom
bust6k:fix-register-auto

Conversation

@bust6k
Copy link
Copy Markdown

@bust6k bust6k commented Mar 22, 2026

General

In parse.c:read_decl_spec added check if register or auto storage-class specifiers at global scope,then throw a warning notice about.

Standard proof

The behavior is registered by C11 6.9.2.Semantics:

2. A declaration of an identifier for an object that has file scope without an initializer, and
without a storage-class specifier or with the storage-class specifier static, constitutes a
tentative definition.

here's register and auto don't as mentioned as tentative definition

Tests

  • test/register.c — warns on register int x = 0;
  • test/auto.c — warns on auto int x = 0;

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