Re:GCC and Clang handle statically known undefined behaviour
by titzer on Tuesday June 25, 2024 @09:51AM
(#40788633)
More knowledge is good. Hopefully it inspires people to avoid UB and demand better diagnostics and debugging tools for UB. Avoiding UB can include such activities as completely avoiding programming in the language that has UB.
UB is a post-facto justification for compiler optimizations that only work on non-buggy programs. It's a circus because programs have bugs.
The resulting "reasoning" can be counter-intuitive, and seeing what happens and what problems it can introduce must be instructive to people who are not aware.
Better informed/educated C programmers is an improvement on the state of the world, in my opinion.