[Bug c++/55077] New: implement and enable by default -Wliteral-conversion
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 25 23:52:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55077
Bug #: 55077
Summary: implement and enable by default -Wliteral-conversion
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: manu@gcc.gnu.org
>From clang:
test.cc:4:23: warning: implicit conversion from 'double' to 'int' changes value
from 3.1415926 to 3 [-Wliteral-conversion]
static const int c = 3.1415926;
~ ^~~~~~~~~
This should be fairly easy, since we warn already with -Wconversion:
1) Change the warning flag.
2) Show the values before/after.
More information about the Gcc-bugs
mailing list