5 ms·
Not defined as part of the standard, but before compilers got as smart about their optimizations, it was easier to have behavior that was technically undefined
by hxtk 4y ago
Not defined as part of the standard, but before compilers got as smart about their optimizations, it was easier to have behavior that was technically undefined but could be reasoned about in practice.
Now that compilers know cleverer optimizations, undefined behavior is often impossible to reason about because the compiler can change your logic into something else that is more optimal and is equivalent to your logic only in well-defined cases.
- astrange 4y agoModern compilers also come with UBSan. Either run it through that, or just always build with it enabled.