[Bug c/53874] New: -Wswitch-enum not properly working with bitfields
jan.smets@alcatel-lucent.com
gcc-bugzilla@gcc.gnu.org
Fri Jul 6 13:06:00 GMT 2012
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: unassigned@gcc.gnu.org
ReportedBy: jan.smets@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
More information about the Gcc-bugs
mailing list