...
Note that compliance with this recommendation does not require that short file names are used, only that the file names are unique.
Noncompliant Code Example
The following noncompliant code contains references to headers that may exist independently in various environments but can be ambiguously interpreted by a C-compliant compiler.
...
Library.h
and library.h
may refer to the same file. Also, because only the first eight characters are guaranteed to be significant, it is unclear whether utilities_math.h
and utilities_physics.h
are parsed. Finally, if a file such as my_libraryOLD.h
exists, it may inadvertently be included instead of my_library.h
.
Compliant Solution
This compliant solution avoids the ambiguity by renaming the associated files to be unique under the preceding constraints.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
| IF_DUPL_HEADER | ||||||||
| hedrname | Fully implemented | |||||||
PRQA QA-C |
| Secondary Analysis | Fully implemented |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...