This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53874] New: -Wswitch-enum not properly working with bitfields
- From: "jan dot smets at alcatel-lucent dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 Jul 2012 13:06:20 +0000
- Subject: [Bug c/53874] New: -Wswitch-enum not properly working with bitfields
- Auto-submitted: auto-generated
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