Hacker News new | ask | show | jobs
by simiones 1167 days ago
The point is that the code is only checked for UB with the arguments it is given at compile time. There is no guarantee that it can't invoke UB with other arguments it might receive at runtime.

For example, here is a modification of the original program that does invoke UB, but compiles just fine:

https://godbolt.org/z/MaqhcEYqn

1 comments

Oh yes, I see your point. Thanks for clarifying