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++/48119] -Wtype-limits should warn when bit masking cannot possibly be true due to type size


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-24
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-24 08:07:35 UTC ---
Sure it is.

    // did the value get to big?
    if(x & 0x10000) {

should be warned about in the frontend before fold get's a chance to
fold it to false (and yes, we do _not_ want to issue warnings from folders...).

Note that from the description of -Wtype-limits it is not clear if we
want to warn here.  Consider templates where usually a load of this
issues can pop up during instantiation.


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