Versions Compared

Key

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

...

The following table from the C Standard, subclause 7.1.2 [ISO/IEC 9899:2011], lists these standard headers:

<assert.h><float.h><math.h><stdatomic.h><stdlib.h><time.h>
<complex.h><inttypes.h><setjmp.h><stdbool.h><stdnoreturn.h><uchar.h>
<ctype.h><iso646.h><signal.h><stddef.h><string.h><wchar.h>
<errno.h><limits.h><stdalign.h><stdint.h><tgmath.h><wctype.h>
<fenv.h><locale.h><stdarg.h><stdio.h><threads.h>
 

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

...

Using header file names that conflict with other header file names can result in an incorrect file being included.

Recommendation

Severity

Likelihood

Remediation Cost

Detectable

Repairable

Priority

Level

PRE04-C

Low

Unlikely

Yes

Medium

No

P2

L3

Automated Detection

ToolVersionCheckerDescription
Axivion Bauhaus Suite

Include Page
Axivion Bauhaus Suite_V
Axivion Bauhaus Suite_V

CertC-PRE04
Cppcheck Premium

Include Page
Cppcheck Premium_V
Cppcheck Premium_V

premium-cert-pre04-c

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.PRE04

Fully implemented

Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C5001
LDRA tool suite
Include Page
LDRA_V
LDRA_V

568 S

Fully implemented

PRQA QA-C Include PagePRQA QA-C_vPRQA QA-C_v5001

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C: Rec. PRE04-C

Checks for reuse of standard header file (rec. fully covered)

Security Reviewer - Static Reviewer

Include Page
Security Reviewer - Static Reviewer_V
Security Reviewer - Static Reviewer_V

RTOS_22Fully implemented

Related Vulnerabilities

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

Related Guidelines

Bibliography

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

...


...

Image Modified Image Modified Image Modified