This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/44811] non controllable bogus warning: right/left shift count is negative
- From: "drwowe at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Apr 2012 21:36:14 +0000
- Subject: [Bug c++/44811] non controllable bogus warning: right/left shift count is negative
- Auto-submitted: auto-generated
- References: <bug-44811-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44811
D W <drwowe at yahoo dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |drwowe at yahoo dot com
--- Comment #3 from D W <drwowe at yahoo dot com> 2012-04-12 21:36:14 UTC ---
I'm also getting a different but similar warning.
Trivial example:
int shiftifbig(int x) {
if (sizeof(x) > 4) {
return x>>32;
} else {
return x;
}
}
produces the following spurious warning:
warning: right shift count >= width of type [enabled by default]
Please gate this warning on something like -Wshift so that the corresponding
-Wno-shift could be used.
Even better, suppress the warning automatically from dead code like in the
above example.