This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]