4 ms·
> language specification doesn't define what should happen during execution. this is subtile misleading unspecified and undefined behavior are not quite the sa
by dathinab 2y ago
> language specification doesn't define what should happen during execution.
this is subtile misleading unspecified and undefined behavior are not quite the same
UB means it's (simplified) specified that the compiler is allowed to do whatever it wants (or more concretely in most cases is allowed to assume that a specific thing is impossible when optimizing to a point where of it does happen pretty much anything can happen including things like it seeming that an int is two different values at the same time or (which might still be one of the more harmless wtfs which can happen))