Versions Compared

Key

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

...

This code tests for signed integer overflow by testing to see if a + 100 > a. This test cannot evaluate to true false unless an integer overflow occurs. However, because a conforming implementation is not required to generate code for undefined behavior, and signed integer overflow is undefined behavior, this code may be compiled out. For example, gcc version 4.1.1 optimizes out the assertion for all optimization levels and gcc 4.2.3 optimizes out the assertion for program compiled with -O2 level optimization and higher.

...