Versions Compared

Key

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

...

This noncompliant code example demonstrates an action being carried out in an assertion. The idea is to delete all the null names from the list, ; however, the boolean expression is unexpectedly not evaluated when assertions are disabled.

...

Automated detection of assertion operands that contain locally-visible side-effects is straightforward. Some analyses may could require programmer assistance to determine which method invocations may could contain side-effects.

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this guideline on the CERT website.

Other Languages

Related Guidelines

This guideline appears in the C Coding Standard as : EXP31-C. Avoid side effects in assertions.This guideline appears in the

C++ Coding Standard as : EXP31-CPP. Avoid side effects in assertions.

Bibliography

[Tutorials 2008] Programming With Assertions

...