[Bug c/59753] Missing -Woverflow warning with signed constant conversion between T_MAX+1 and UT_MAX

vincent-gcc at vinc17 dot net gcc-bugzilla@gcc.gnu.org
Wed Feb 5 11:40:00 GMT 2014


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

Vincent Lefèvre <vincent-gcc at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WORKSFORME                  |---

--- Comment #2 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
-Wconversion is used to warn about possibly-suspicious valid code such as:

  unsigned ui = -1;

(see the gcc man page), not for overflows. At least there is an inconsistency
in the use of warnings. There is no reason why 65535 and 65536 should be
treated differently when assigned to a short: neither value is representable in
a short.


More information about the Gcc-bugs mailing list