struct { unsigned int x:1; } foo; int bar = 0; foo.x = bar != 0; // warning foo.x = bar != 0 ? 1 : 0; // warning if (bar != 0) foo.x = 1; else foo.x = 0; // no warnings, but too ugly..
-- Summary: -Wconversion problematic with bitfields Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tss at iki dot fi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35635