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/37560] New: bitfield not promoted to int


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


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