Comment by MobiusHorizons

6 days ago

UB is not undocumented. It is documented to not be defined. In fact any given hardware reacts deterministically in the majority of UB cases, but compilers are allowed to assume UB was not possible for the purposes of optimization.

The trigger for UB is documented, the result is not documented.

And despite the triggers being documented, they're very very hard to avoid completely.