In the following program, the type of the assignment expression "f.x = 1"
should be int, according to the integer promotion rules.
However, gcc 4.xx (on all architectures I've tested) prints "1".


#include <stdio.h>
int main()
{
        struct foo { int x:1; } f;
        printf("%u\n", sizeof(f.x = 1));
        return 0;
}


-- 
           Summary: bitfield not promoted to int
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: clemens at ladisch dot de
GCC target triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37560

Reply via email to