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/35635] -Wconversion problematic with bitfields



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


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