This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48119] -Wtype-limits should warn when bit masking cannot possibly be true due to type size
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Oct 2011 08:07:35 +0000
- Subject: [Bug c++/48119] -Wtype-limits should warn when bit masking cannot possibly be true due to type size
- Auto-submitted: auto-generated
- References: <bug-48119-4@http.gcc.gnu.org/bugzilla/>
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.