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:
<complex<ctype<errno<fenv<float| <complex.h> | <inttypes.h> | <setjmp.h> | 
<iso646<limits<locale<math<setjmp<stdarg<stdbool<stddef<stdint<stdio<stdlib<string<time| <wctype.h> | 
| <fenv.h> | <locale.h> | 
<uchar<wchar<wctype Do not reuse standard header file names, system-specific header file names, or other header file names.
...
In this noncompliant code example, the programmer chooses to use a local version of the standard library but does not make the change clear.:
| Code Block | 
|---|
|  | 
| #include "stdio.h"  /* confusingConfusing, distinct from <stdio.h> */
/* ... */
 | 
...
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.:
| Code Block | 
|---|
|  | 
| /* Using a local version of stdio.h */ 
#include "mystdio.h"
/* ... */
 | 
...
Using header file names that conflict with other header file names can result in an incorrect file being included.
| Recommendation | Severity | Likelihood | Detectable | 
|---|
Remediation Cost| Repairable | Priority | Level | 
|---|
| PRE04-C | Low | 
lowunlikelymediumAutomated Detection
218 SECLAIRECLAIRECLAIR| hedrname | Fully implemented | PRQA QA-C | | Include Page | 
|---|
PRQA_V | PRQA_VSecondary analysis |  Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
...
...
...
...
Bibliography
...
| ] | Subclause 7.1.2, "Standard | 
...
...
 Image Modified
Image Modified  Image Modified
Image Modified  Image Modified
Image Modified