This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50810] New: c++0x-compat does not warn about narrowing conversions
- From: "public at alisdairm dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Oct 2011 13:41:08 +0000
- Subject: [Bug c++/50810] New: c++0x-compat does not warn about narrowing conversions
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50810
Bug #: 50810
Summary: c++0x-compat does not warn about narrowing conversions
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: public@alisdairm.net
The following program is rejected by g++ in -std=c++0x mode (assuming 'char' is
signed) but does not raise any warnings when compiled with -Wc++0x-compat:
int main() {
char data[] = { 0xff };
char value = 0xff;
}
This is significantly the largest source of compatibility errors in our
code-base today (>95% of our known issues), so it would be very useful if the
warning caught these.