Skip to content

Clang should warn on the use of reserved identifier/macro names #11860

@rubenvb

Description

@rubenvb
Bugzilla Link 11488
Resolution FIXED
Resolved on Aug 18, 2021 09:50
Version trunk
OS All
CC @davidstone,@gnzlbg,@miyuki,@seanm,@spavloff

Extended Description

For C, Clang should warn when user code uses identifiers or macros that are implementation-reserved.

For C(99), this would mean names starting with an underscore followed by another unerscore or capitalized letter.

For C++ a single underscore is also reserved for the global namespace.

I could have messed the above rules up, but these are the cause of a lot of unexpected bugs, and a warning would be super-easy to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions