This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59753] -Woverflow warning inconsistency with signed constant conversion between T_MAX+1 and UT_MAX vs larger than UT_MAX
- From: "vincent-gcc at vinc17 dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Feb 2018 12:01:04 +0000
- Subject: [Bug c/59753] -Woverflow warning inconsistency with signed constant conversion between T_MAX+1 and UT_MAX vs larger than UT_MAX
- Auto-submitted: auto-generated
- References: <bug-59753-4@http.gcc.gnu.org/bugzilla/>
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.