Comment by Dylan16807
6 days ago
> or claiming the behavior of an instruction is different than documented
When talking about undefined behavior, the only documentation is a shrug emoticon. If you want a working program, arbitrary undocumented behavior is just as bad as incorrectly documented behavior.
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.