...
Failing to parenthesize macro replacement lists can cause unexpected results.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
PRE02-C | Medium | Probable | Low | P12 | L1 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
CodeSonar |
| LANG.PREPROC.MACROEND LANG.PREPROC.MACROSTART | Macro Does Not End With ) or } Macro Does Not Start With ( or { | ||||||
| CC2.PRE02 | Fully implemented | |||||||
Klocwork |
| MISRA.DEFINE.BADEXP |
LDRA tool suite |
| 77 S | Fully implemented | ||||||
Parasoft C/C++test |
|
|
| MISRA-096 | Fully implemented | |||||||
PRQA QA-C |
| 3409 | Fully implemented |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
SEI CERT C++ Coding Standard | VOID PRE02-CPP. Macro replacement lists should be parenthesized |
ISO/IEC TR 24772:2013 | Operator Precedence/Order of Evaluation [JCW] Pre-processor Directives [NMP] |
Bibliography
[Plum 1985] | Rule 1-1 |
[Summit 2005] | Question 10.1 |
...
...