This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20019] incorrect overflow warning
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Nov 2006 13:51:07 -0000
- Subject: [Bug c++/20019] incorrect overflow warning
- References: <bug-20019-6594@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from manu at gcc dot gnu dot org 2006-11-25 13:51 -------
I don't get the warning with current mainline (revision 119143).
Still, I would like to keep this bug around since it may be interesting that
Wconversion emits a warning for the int->char conversion. I would like to hear
some opinions about this. My current patch does the following:
manuel@gcc05:~$ local/bin/g++ -fsigned-char pr20019.cpp
manuel@gcc05:~$ local/bin/g++ -fno-signed-char pr20019.cpp
manuel@gcc05:~$ local/bin/g++ -fno-signed-char -Wconversion pr20019.cpp
pr20019.cpp:9: warning: negative integer implicitly converted to unsigned type
pr20019.cpp:13: warning: negative integer implicitly converted to unsigned type
manuel@gcc05:~$ local/bin/g++ -fsigned-char -Wconversion pr20019.cpp
pr20019.cpp:3: warning: conversion to ?char? alters ?int? constant value
pr20019.cpp:7: warning: conversion to ?char? alters ?int? constant value
pr20019.cpp:11: warning: conversion to ?char? alters ?int? constant value
Does this seem correct to all of you?
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20019