[Bug c++/55095] New: Wshift-overflow
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Oct 27 09:06:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55095
Bug #: 55095
Summary: Wshift-overflow
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: manu@gcc.gnu.org
From: http://blog.llvm.org/2011/05/c-at-google-here-be-dragons.html
const long kMaxDiskSpace = 10 << 30; // Ten gigs ought to be enough for
anybody.
clang++ (no other options)
test.c:1:31: warning: signed shift result (0x280000000) requires 35 bits to
represent, but 'int' only has 32 bits [-Wshift-overflow]
const long kMaxDiskSpace = 10 << 30; // Ten gigs ought to be enough for
anybody.
~~ ^ ~~
1 warning generated.
g++ -Wall -Wextra -Wconversion:
silence. :-(
More information about the Gcc-bugs
mailing list