This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61405] Not emitting "enumeration value not handled in switch" warning for bit-field enums
- From: "jamborm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jun 2014 16:12:32 +0000
- Subject: [Bug c/61405] Not emitting "enumeration value not handled in switch" warning for bit-field enums
- Auto-submitted: auto-generated
- References: <bug-61405-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61405
--- Comment #1 from Martin Jambor <jamborm at gcc dot gnu.org> ---
The reason why we do not emit is that in c_do_switch_warnings in
c-family/c-common.c we check that:
/* From here on, we only care about about enumerated types. */
if (!type || TREE_CODE (type) != ENUMERAL_TYPE)
return;
which fails because (unlike in the non-bit-field case) type is:
<integer_type 0x7ffff6d5e150 public unsigned QI
size <integer_cst 0x7ffff6c34768 type <integer_type 0x7ffff6c36150
bitsizetype> constant 8>
unit size <integer_cst 0x7ffff6c34780 type <integer_type 0x7ffff6c360a8
sizetype> constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7ffff6d5e150 precision 2 min
<integer_cst 0x7ffff6d4adc8 0> max <integer_cst 0x7ffff6d4ade0 3>>