|
|
|
|
|
by torstenvl
687 days ago
|
|
> the reality is that compilers do treat UB this way No, they really don't. https://godbolt.org/z/M6hcTx3aY Clang will not blow your computer up just because you use #pragma STDC FENV_ROUND <direction> in accordance with its documentation. I don't know why it became popular to make UB into a bogeyman and act like it's an intractable problem, but it isn't. Compilers handle most UB just fine.* It's better for everyone if we can focus on the actual problems rather than blowing it out of proportion with sweeping generalizations. * All undefined behavior is undefined, but some undefined behavior is more undefined than others. |
|
It sounds like you agree that programmers should avoid relying on luck for UB safety. If you have a way to prove that this UB is actually safe and not just lucky, feel free to present it. Until then, I stand by everything I’ve said.