back

by uecker·2y ago·view on hn ↗
I do not think C's UB is damaging. As I said, you instruct the compiler to insert a trap and then it is not unsafe.

Example: https://godbolt.org/z/Kvrrx19Pa

The UB in the spec is exactly what makes safe use possible without enforcing it everywhere, which is not feasible for C.