...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
|
| Can detect simple violations of this rule. It needs to examine each expression and make sure that no variable is modified twice in the expression. It also must check that no variable is modified once, then read elsewhere, with the single exception that a variable may appear on both the left and right of an assignment operator | |||||||
| EVALUATION_ORDER | Can detect the specific instance where a statement contains multiple side effects on the same value with an undefined evaluation order because, with different compiler flags or different compilers or platforms, the statement may behave differently | |||||||
| CC2.EXP30 | Fully implemented | |||||||
|
| Can detect violations of this rule when the | |||||||
| 35 D | Fully implemented | |||||||
|
|
| |||||||
PRQA QA-C++ |
| 3220,3221,3222,3223 | |||||||
SonarQube Plugin |
| IncAndDecMixedWithOtherOperators |
...
CERT C Secure Coding Standard | EXP30-C. Do not depend on the order of evaluation for side effects |
CERT Oracle Secure Coding Standard for Java | EXP05-J. Do not write more than once to the same variable follow a write by a subsequent write or read of the same object within an expression |
ISO/IEC TR 24772:2013 | Operator Precedence/Order of Evaluation [JCW] Side-effects and Order of Evaluation [SAM] |
MISRA C:2012 | Rule 12.1 (advisory) |
...