3 ms·
Undefined behavior does not need to be consistent, either across different programs, or within the same program. It does not need to be consistent within diffe
by MereInterest 7y ago
Undefined behavior does not need to be consistent, either across different programs, or within the same program. It does not need to be consistent within different times that the program is run, and it does not need to be documented anywhere. It does not need to be sensible, does not need to be predictable, and does not need to give any diagnostics to warn the programmer. Undefined behavior means that you have passed outside of the realm governed by the standard, and that HERE BE DRAGONS.
Implementation-defined behavior works as you say, where each compiler can define how it responds to certain circumstances.