News for hackers. Stuff that matters.
Re:Clang vs. Clang by myrryr on Sunday August 04, 2024 @02:12AM (#41151442)
Yes! This is exactly the point. It is undefined, so given that, it could do what the other branch does, so you can safely remove that branch.

you get it, but a lot of other people don't understand just how undefined, undefined code is.

Re:Clang vs. Clang by SonOfLilit on Sunday August 04, 2024 @03:05AM (#41151635)
We do. We just wish undefined was defined to be a bit less undefined, and are willing to sacrifice a bit of performance for higher debuggability an. ability to reason.
Re:Clang vs. Clang by uecker on Sunday August 04, 2024 @04:39AM (#41152009)
Why not use -fsanitize=signed-integer-overflow ?
Re:Clang vs. Clang by Dylan16807 on Sunday August 04, 2024 @12:20PM (#41154502)
It could do what the other branch does, in theory.

But let me put it this way. If you only had the misbehaving_code(); line by itself, the compiler would rightly be called crazy and malicious if it compiled that to delete_data();

So maybe it's not reasonable to treat both branches as having the same behavior, even if you can.