If a file with the same name as a standard header is placed in the search path for included source files, the behavior is undefined.
The following table from the C Standard, subclause 7.1.2 [ISO/IEC 9899:2011], lists these standard headers:
Do not reuse standard header file names, system-specific header file names, or other header file names.
Noncompliant Code Example
In this noncompliant code example, the programmer chooses to use a local version of the standard library but does not make the change clear:
The solution addresses the problem by giving the local library a unique name (per PRE08-C. Guarantee that header file names are unique), which makes it apparent that the library used is not the original:
Using header file names that conflict with other header file names can result in an incorrect file being included.
|Axivion Bauhaus Suite|
|LDRA tool suite|
|SEI CERT C++ Coding Standard||VOID PRE04-CPP. Do not reuse a standard header file name|
|CERT Oracle Secure Coding Standard for Java||DCL01-J. Do not reuse public identifiers from the Java Standard Library|
|[ISO/IEC 9899:2011]||Subclause 7.1.2, "Standard Headers"|