This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55095] New: Wshift-overflow
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Oct 2012 09:06:18 +0000
- Subject: [Bug c++/55095] New: Wshift-overflow
- Auto-submitted: auto-generated
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. :-(