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++/44811] non controllable bogus warning: right/left shift count is negative


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.


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