[Bug c++/55671] New: -Wconversion fails to warn for sign-conversion
loose at astron dot nl
gcc-bugzilla@gcc.gnu.org
Thu Dec 13 08:46:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55671
Bug #: 55671
Summary: -Wconversion fails to warn for sign-conversion
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: loose@astron.nl
g++ doesn't warn about the following statement when using -Wconversion, whereas
gcc does.
$ cat Wconversion-bug.c
unsigned i = -1;
$ g++ -Wconversion -c Wconversion-bug.c
[no output]
$ gcc -Wconversion -c Wconversion-bug.c
Wconversion-bug.c:1:1: warning: negative integer implicitly converted to
unsigned type [-Wsign-conversion]
$ g++ --version
g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
More information about the Gcc-bugs
mailing list