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

             Bug #: 53874
           Summary: -Wswitch-enum not properly working with bitfields
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jan.sm...@alcatel-lucent.com


typedef enum
{
    A,
    B,
    C
} tEnum;


typedef struct t_A
{
 tEnum         my_enum:4;
} tA;


int test(tA * bla)
{
 switch(bla->my_enum)
 {
     default:
         return 0;
 }
}



I expect the compiler to complain:

test-enum.c:23: warning: enumeration value `A' not handled in switch
test-enum.c:23: warning: enumeration value `B' not handled in switch
test-enum.c:23: warning: enumeration value `C' not handled in switch

I verified this works in GCC 3.4 but not in GCC 4.6.

Thanks

Reply via email to