Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.13 KB

undef.mkd

File metadata and controls

40 lines (27 loc) · 1.13 KB

Undefined Behavior

Undefined behavior has three purposes:

  • Language Extensions
  • Erroneous Behavior
  • Optimization

According to my reading of the C standard, UB is behavior that occurs for certain conditions. Consequently, it does not imply an impossible assumption.

Compilers can still derive assumptions: If there are no restrictions on the behavior, than all consequences from optimizations using the assumption are ok, as long as previous observable behavior is not affected.

Time Travel

C++ allows time-travel. Time-travel of UB causes real world issues:

Literature