Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
bgColor#FFcccc
langc
#include "stdio.h"  /* confusing, 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
bgColor#ccccFF
langc
/* Using a local version of stdio.h */ 
#include "mystdio.h"

/* ... */

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

Bibliography

[ISO/IEC 9899:2011]Section 7.1.2, "Standard Headers"