...
Wiki Markup |
---|
According to C99, Section 6.5 \[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] (see also [undefined behavior 32 | CC. Undefined Behavior#ub_32] of Annex J): |
Between the previous and next sequence point an object can only have its stored value modified once by the evaluation of an expression. Additionally, the prior value can be read only to determine the value to be stored.
(See also undefined behavior 32 of Annex J.)
This requirement must be met for each allowable ordering of the subexpressions of a full expression; otherwise, the behavior is undefined.
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
EXP30-C | medium | probable | medium | P8 | L2 |
Automated Detection
Splint Version 3.1.1 can detect violations of this rule.
...
Tool | Version | Checker | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
| ||||||||||
|
|
|
| ||||||||||
|
|
|
|
...
|
|
|
...
|
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Other Languages
Related Guidelines
This rule appears in the C++ Secure Coding Standard as : EXP30-CPP. Do not depend on order of evaluation between sequence points.
This rule appears in the Java Secure Coding Standard as : EXP09-J. Do not depend on operator precedence while using expressions containing side-effects.
Bibliography
Wiki Markup |
---|
\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 5.1.2.3, "Program execution," Section 6.5, "Expressions," and Annex C, "Sequence points" \[[ISO/IEC PDTR 24772|AA. Bibliography#ISO/IEC PDTR 24772]\] "JCW Operator precedence/Order of Evaluation" and "SAM Side-effects and order of evaluation" \[[MISRA 042004|AA. Bibliography#MISRA 04]\] Rule 12.1 \[[Summit 052005|AA. Bibliography#Summit 05]\] Questions 3.1, 3.2, 3.3, 3.3b, 3.7, 3.8, 3.9, 3.10a, 3.10b, and 3.11 \[[Saks 072007|AA. Bibliography#Saks 07]\] |
...