5 ms·
> don't cause UB to be executed at run time. The insidious thing about UB is that it doesn't necessarily have to be executed to wreck your program. UB is not p
by classified 7d ago
> don't cause UB to be executed at run time.
The insidious thing about UB is that it doesn't necessarily have to be executed to wreck your program. UB is not primarily about runtime behavior, it's about how the compiler interprets your code. The behavior that is undefined is your compiler's behavior.
- chowells 7d agoYou're right. I didn't enumerate every way UB can make a program go wrong. I'm sure I don't even know every way that can happen. But "UB doesn't happen at run time" is an assumption that lots of "optimizations" are based on.