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

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
That's not undefined. It very clearly says "implementation-defined", not
undefined.

GCC defines it here:
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html

"For conversion to a type of width N, the value is reduced modulo 2^N to be
within range of the type; no signal is raised."


So no, doing unsigned arithmetic and then converting to a signed type is not
equally undefined, it's fine.

Reply via email to