CERT-DCL36-C
In this section:
Synopsis
Do not declare an identifier with conflicting linkage classifications.
Enabled by default
Yes
Severity/Certainty
Medium/High

Full description
Linkage can make an identifier declared in different scopes or declared multiple times within the same scope refer to the same object or function. Use of an identifier (within one translation unit) classified as both internally and externally linked is undefined behavior.
Coding standards
- CERT DCL36-C
Do not declare an identifier with conflicting linkage classifications
Code examples
The following code example fails the check and will give a warning:
static int i2 = 20;
int i2;
void example(void) {}
The following code example passes the check and will not give a warning about this issue:
int i1 = 10;
int i1;
void example(void) {}