...
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 |
| macro-argument-hash | Fully checked | ||||||
| CodeSonar |
| LANG.PREPROC.MACROARG | Preprocessing directives in macro argument | ||||||
| CC2.PRE32 | Fully implemented | |||||||
| LDRA tool suite |
| 341 S | Fully implemented | ||||||
| R2018a | Preprocessor directive in macro argument | You use a preprocessor directive in the argument to a function-like macro | |||||||
| PRQA QA-C |
| 853 |
| PRQA QA-C++ |
| 1072 |
| RuleChecker |
| macro-argument-hash | Fully 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" |
...
...