Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added Polyspace Bug Finder

...

Including preprocessor directives in macro arguments is undefined behavior.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

PRE32-C

Low

Unlikely

Medium

P2

L3

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
macro-argument-hashFully checked
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
LANG.PREPROC.MACROARGPreprocessing directives in macro argument

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.PRE32

Fully implemented

LDRA tool suite
Include Page
LDRA_V
LDRA_V
341 SFully implemented

Polyspace Bug Finder

R2018aPreprocessor directive in macro argumentYou use a preprocessor directive in the argument to a function-like macro
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
853
 

PRQA QA-C++
 

1072 
 


RuleChecker
Include Page
RuleChecker_V
RuleChecker_V
macro-argument-hashFully checked

Related Vulnerabilities

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

Bibliography

[GCC Bugs]"Non-bugs"
[ISO/IEC 9899:2011]6.10.3, "Macro Replacement"

...


...