Declared name uses an underscore prefix the standard reserves
ID |
c.maintainability.naming_reserved_identifier |
Severity |
info |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Naming |
Language |
C / C++ |
Description
Reports a variable or function declared with a name that starts with an underscore followed by an uppercase letter (_Config), or that contains a double underscore anywhere (init, statepending). Both forms are reserved for the implementation - the compiler, the standard library, and the platform headers - in every scope.
Rationale
A name in this shape is not merely a style violation: the standard reserves it for the compiler and the C library, which are free to define a macro or an internal symbol with the exact same spelling. Including a system header that happens to use the same reserved name for its own purpose silently redefines it, shadows it, or triggers a macro expansion the author never intended, and the resulting failure depends on which headers are pulled in and in what order - it can appear or vanish across platforms and compiler versions.
The following code illustrates the pattern detected by this rule:
// FLAGGED: Declared name uses an underscore prefix the standard reserves
int _Config;