This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
enumeration value ... not handled in switch
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Subject: enumeration value ... not handled in switch
- From: "Schirmer, Hartmut" <SchirmerH at Innovative-Systems dot de>
- Date: Mon, 24 Sep 2001 10:06:21 +0200
- Cc: "'hartmut dot schirmer at arcormail dot de'" <hartmut dot schirmer at arcormail dot de>
Hi,
is there any way to tell GCC to warn about unhandled
enum values in switch-case statements even if a default
case is present?
Currently I have to do ugly things like
flag = 0;
switch ( e )
{
case e1: flag = 1; break;
case e2: flag = 1; break;
}
if ( !flag )
{
// default case
}
to get both, the default case and the warning.
Adding an attribute to default: would be ok in this case.
Thanks,
Hartmut