https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124223

--- Comment #10 from stano at meduna dot org ---
(In reply to Jonathan Wakely from comment #8)
> Why aren't you just doing arithmetic on the unsigned types?
> 
>         int32_t diff = values[i] - 0x80000000;

well this is from a codebase of hundreds of thousands lines running on several
compilers and platforms and some of the dozens of developers just happened to
write that years ago... Thank all for the hints and I apologize for not
spotting the flags to try first.

However, technically speaking, this line is equally an undefined behavior as
the original cast, is it not?

Reply via email to