According to section Section 6.2.7 of C99 (see also undefined behavior 14 of Annex J):
All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined.
(See also undefined behavior 14 of Annex J.)
Further, according to 6.4.2.1, paragraph 6 (see also undefined behavior 28 of Annex J):
Any identifiers that differ in a significant character are different identifiers. If two identifiers differ only in nonsignificant characters, the behavior is undefined.
(See also undefined behavior 28 of Annex J.)
Identifiers in mutually visible scopes must be deemed unique by the compiler, to prevent confusion about which variable or function is being referenced. Implementations can allow additional nonunique non-unique characters to be appended to the end of identifiers, making the identifiers appear unique while actually being indistinguishable.
...
For portability, the first three universal character name combination combinations used in an identifier must be unique.
| Code Block | ||
|---|---|---|
| ||
extern int *\U00010401\U00010401\U00010401\U00010401; extern int *\U00010402\U00010401\U00010401\U00010401; |
Risk Assessment
Nonunique Non-unique identifiers can lead to abnormal program termination, denial-of-service attacks, or unintended information disclosure.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
DCL32-C | medium | unlikely | low | P6 | L2 |
Automated Detection
...
Tool | Version | Checker | Description |
|---|---|---|---|
|
...
|
|
| ||||||||
|
|
|
|
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...
| Wiki Markup |
|---|
\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 5.2.4.1, "Translation limits" \[[ISO/IEC PDTR 24772|AA. Bibliography#ISO/IEC PDTR 24772]\] "AJN Choice of Filenames and Other External Identifiers" and "YOW Identifier name reuse" \[[MISRA 042004|AA. Bibliography#MISRA 04]\] Rules 5.1 and 8.9 |
...