The value of an expression and its persistent side effects shall be the same under all permitted evaluation orders
The value of an expression and its persistent side effects shall be the same under all permitted evaluation orders.
If an expression results in different values depending on the order of evaluation, its value becomes implementation-defined.
Polyspace® raises a violation if an expression satisfies any of these conditions:
The same variable is modified more than once in the expression or it is both read and written.
The expression allows more than one order of evaluation.
The expression contains a single volatile object
that occurs multiple times.
The expression contains more than one volatile
object.
Because volatile objects can change their value at
anytime, an expression containing multiple volatile variables or
multiple instances of the same volatile variable might have
different results depending on the order of evaluation.
The value of 'XX' depends on the order of evaluation. The value of volatile 'XX' depends on the order of evaluation because of multiple accesses.
If you expect a rule violation but do not see it, refer to the documentation of Polyspace Code Prover™ or Polyspace Code Prover Server™.
| Group: Side Effects |
| Category: Required |
| AGC Category: Required |
MISRA C:2012 Dir 4.9 | MISRA C:2012 Rule 13.1 | MISRA C:2012 Rule 13.3 | MISRA C:2012 Rule 13.4