C++ float-to-int conversion can be undefined behavior
https://kttnr.net/blog/cpp-float-to-int-conversion-undefined-behavior/Herb Sutter's comment on why it's ok is confusing to me:
> Regarding the use of UB internally: It's okay and if anyone is worried about it the use of UB is benign on the platforms we target (e.g., they don't involve hitting any hardware trap representations for these types)
Isn't the outcome of the UB (ie. whether it will "rm -rf /" or something else) dependent on both the target and the compiler? And the compiler (or future compiler) could plausibly make the assumption that the narrowing to an unrepresentable value will never occur and change behaviour because of it?
loading story #49158712
loading story #49158991
loading story #49159928
loading story #49158612
loading story #49158426
loading story #49158768
loading story #49159866
loading story #49158385
loading story #49108062
loading story #49160210
loading story #49158487
loading story #49111584
loading story #49160334
loading story #49108016