Rendered at 11:54:56 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
digitalPhonix 17 hours ago [-]
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 unpreventable value will never occur and change behaviour because of it?
lionkor 20 hours ago [-]
The core guidelines library is definitely not doing the right thing here. Very odd.
> 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 unpreventable value will never occur and change behaviour because of it?