Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Any expression that calls two functions between the same sequence points
  • Those two functions both modify the value of a static variable
  • That static variable's value is referenced by code following the expression

The Coverity Prevent Version 5.0 EVALUATION_ORDER checker can detect the specific instance where 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.

One could also violate the recommendation using dynamic memory passed to both functions, but that would be extremely difficult to detect using static analysis.

...