This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/20019] incorrect overflow warning



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]