News for hackers. Stuff that matters.
Re:A Guide to Undefined Behavior in C and C++ by jenadine on Friday August 18, 2023 @01:03AM (#37171538)
> except replace all UB with defined behavior and it wouldn't make the naive compiler any different.

I wonder how you will define use after free

Re:A Guide to Undefined Behavior in C and C++ by adgjlsfhk1 on Friday August 18, 2023 @01:13AM (#37171582)
returns a random value or errors. the main problem with UB isn't that it has unpredictable behavior, it's that it also inserts an unreachable that allows the compiler to assume it doesn't happen.
Re:A Guide to Undefined Behavior in C and C++ by colejohnson66 on Friday August 18, 2023 @10:17AM (#37175938)
Clarifying UB as “inserting a ‘__builtin_unreachable()’” actually just cleared up a lot of confusions I’ve had!