This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/34389] -Wconversion produces wrong 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: 13 Dec 2007 21:38:26 -0000
- Subject: [Bug c/34389] -Wconversion produces wrong warning
- References: <bug-34389-5307@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from manu at gcc dot gnu dot org 2007-12-13 21:38 -------
Confirmed.
When the expression "x & (short)0x7fff" reaches the warning code, it sees
"(int)x & 0x7fff". So it rightfully warns that an "int" expression is converted
to "short". This comes from conversions performed in build_binary_op. Not sure
what the appropriate fix would be...
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-12-13 21:38:26
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34389