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.
[ Parent
| on HN ]
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!