[Bug c/97982] integer casting after abs() causes undefined behavior
mytbk920423 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Nov 25 09:44:16 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97982
--- Comment #1 from Iru Cai <mytbk920423 at gmail dot com> ---
Hmm, I saw in the abs(3) that "Trying to take the absolute value of the most
negative integer is not defined."
But it's still strange to see a uint32->uint64_t cast results in a negative
value.
More information about the Gcc-bugs
mailing list