Hacker News new | past | comments | ask | show | jobs | submit
UB is does not automatically make things unsafe. You can have a compiler that implements safe defaults for most UB, and then it is not unsafe.
That's implementation defined behavior, not undefined behavior. Undefined behavior explicitly refers to something the compiler does not provide a definition for, including "safe defaults."
loading story #41854616
loading story #41853169
Well Zig has ReleaseSafe for this.. ReleaseFast is for using these UBs to generate the fastest code.
{"deleted":true,"id":41853083,"parent":41852363,"time":1729026129,"type":"comment"}
By definition UB cannot be safe.
loading story #41854910
loading story #41853174