This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31153] -Wconversion does not catch return value mismatch
- 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: 12 Mar 2007 22:25:07 -0000
- Subject: [Bug c/31153] -Wconversion does not catch return value mismatch
- References: <bug-31153-9156@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from manu at gcc dot gnu dot org 2007-03-12 22:25 -------
Wconversion is implemented in the front-end and there is no data-flow solving
on front-ends, so basically it is impossible to know the value of i.
In addition, up to GCC 4.3, Wconversion was not meant to warn about
signed->unsigned conversion, just for the negative constant case. From GCC 4.3,
the behaviour of Wconversion will change. See
http://gcc.gnu.org/wiki/NewWconversion
However, the new Wconversion will not produce warnings for signedness change as
in your testcase, since it results in too many warnings in real-world code
(Mozilla, libstdc++, Linux kernel, etc).
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31153