[Bug c/59753] -Woverflow warning inconsistency with signed constant conversion between T_MAX+1 and UT_MAX vs larger than UT_MAX

vincent-gcc at vinc17 dot net gcc-bugzilla@gcc.gnu.org
Tue Feb 20 12:02:00 GMT 2018


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

--- Comment #8 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
Bug 41138 may be different because the target variable has an unsigned integer
type. One may not necessarily want a warning when only unsigned integers are
involved because much code uses the (standard) modular arithmetic feature of
unsigned integer arithmetic. From this point of view, bug 41138 isn't a bug.

On the contrary, here, real overflows in signed integer arithmetic (or
conversions to a signed integer) occur in all cases.


More information about the Gcc-bugs mailing list