Undefined behavior
= Undefined behavior
<Undefined behavior> is behavior for which a <programming language> specification imposes no requirements when a specified erroneous condition occurs. It is not a promise to select one arbitrary but otherwise constrained result. The <C programming language> uses this category for conditions including signed <integer overflow>.<C11 committee draft N1570>[§3.4.3 and §6.5 paragraph5]{ref}
For example, evaluating `x+1` as signed `int` when `x` is the largest representable `int` has <undefined behavior> in that model. A <compiler> can therefore reason that `x+1` exceeds `x` on executions where the addition is defined, instead of preserving an assumed wraparound case. <Unsigned integer arithmetic in C> has different rules. Observing a particular result in one build is insufficient to establish a contract; correctness needs range checks, suitable representations or another explicitly defined operation.