[Bug c/97982] integer casting after abs() causes undefined behavior

2020-11-25 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97982 Andreas Schwab changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/97982] integer casting after abs() causes undefined behavior

2020-11-25 Thread mytbk920423 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97982 --- Comment #1 from Iru Cai --- 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.