Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added code samples

...

Do not reuse standard header file names, system specific header file names, or other header file names.

Non-Compliant Code Example

In this NCCE the programmer chooses to use a local version of the standard library, but does not make the change clear.

Code Block
bgColor#ffcccc

#include "stdio.h"

/* ... */

Compliant Solution

Wiki Markup
The solution addresses the problem by giving the local library a unique name (as per \[[PRE08-A. Guarantee that header filenames are unique]\]) which makes it explicit that the library used is not the original.

Code Block
bgColor#ccccff

#include "mystdio.h"

/* ... */

Risk Assessment

Using header names that conflict with the C standard library functions can result in not including the intended file.

...