[Bug c++/50011] [C++0x] warning: narrowing conversion of 'i' from 'short unsigned int' to 'int' inside { } [-Wnarrowing]

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 8 10:08:00 GMT 2011


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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.08.08 10:02:27
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-08 10:02:27 UTC ---
+      if ((TYPE_PRECISION (type) < TYPE_PRECISION (ftype)
+       || TYPE_UNSIGNED (type) != TYPE_UNSIGNED (ftype))

looks wrong.  I guess it should be

      if ((TYPE_PRECISION (type) < TYPE_PRECISION (ftype)
          || (TYPE_PRECISION (type) == TYPE_PRECISION (ftype)
              && TYPE_UNSIGNED (type) != TYPE_UNSIGNED (ftype)))

instead.



More information about the Gcc-bugs mailing list