News for hackers. Stuff that matters.
Re:Falsehoods programmers believe about undefined behavior by account42 on Monday November 28, 2022 @09:54AM (#33774334)
The linked article argues that making storing invalid values in the bool undefined (rather than just using such bools) is important because otherwise the compiler is not allowed to move the code (without adding appropriate checks that it would have been reached). The compiler can only make that transformation if it has no effect on any cases where the code wasn't reached at all, which includes not introducing any new UB in those cases. Predrag conclusion that this means having UB in dead code matters is simply wrong.

There are no comments on this comment yet.