This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35635] -Wconversion problematic with bitfields
- 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: 8 Jun 2008 16:45:16 -0000
- Subject: [Bug c/35635] -Wconversion problematic with bitfields
- References: <bug-35635-15940@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 2008-06-08 16:45 -------
Confirmed.
Notes:
foo.x = bar != 0; // only warns in C, not in C++.
foo.x = bar != 0 ? 1 : 0; // warning is not a problem of bitfields but for
every conditional expression, the following also warns
short x = (bar != 0) ? 1 : 0; // conversion to ?short int? from ?int? may alter
its value
To fix the two last warnings, we need to look into the arguments of the
conditional expression.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-06-08 16:45:16
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35635