This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wswitch and default case
- From: Hartmut Schirmer <hartmut dot schirmer at arcormail dot de>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 24 Nov 2001 20:02:02 +0100
- Subject: Re: -Wswitch and default case
- References: <87k7whdtlt.fsf@creche.redhat.com>
- Reply-to: hartmut dot schirmer at arcormail dot de
On Fri, 23 Nov 2001, Tom Tromey wrote:
>I've run into a case where I'd like to use -Wswitch but also have a
>default case in my switch.
>
[...]
>Has anybody tried to implement this change?
>If not I'll submit a feature request.
I like this feature. Itīs hard to write robust code
in C using enumīs and switches and gcc diagnostic could
be much better here.
One could introduce a command line option like -Wswitch-all
or/and enable this option in the source for every default that
should be hidden by adding an attribute to default or use a
special version like __default / __silent_default / ...
Hartmut