...
Incorrect use of relational and equality operators can lead to incorrect control flow.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
EXP13-C | Low | Unlikely | Medium | P2 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
| CC2.EXP13 | Fully implemented | |||||||
GCC |
|
Option | |||||||||
LDRA tool suite |
| 433 S | Fully implemented | ||||||
Polyspace Bug Finder | R2016a | Possibly unintended evaluation of expression because of operator precedence rules | Operator precedence rules cause unexpected evaluation order in arithmetic expression | ||||||
PRQA QA-C |
| 3392 | Fully implemented | ||||||
PVS-Studio | 6.22 | V709 | General analysis rule |
Related Guidelines
SEI CERT C++ Coding Standard | VOID EXP17-CPP. Treat relational and equality operators as if they were nonassociative |
Bibliography
[ISO/IEC 9899:2011] | Subclause 6.5.8, "Relational Operators" |
...
...