This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wswitch and default case
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: tromey at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: 25 Nov 2001 00:04:38 -0200
- Subject: Re: -Wswitch and default case
- Organization: GCC Team, Red Hat
- References: <87k7whdtlt.fsf@creche.redhat.com>
On Nov 23, 2001, Tom Tromey <tromey@redhat.com> wrote:
> Has anybody tried to implement this change?
Not as far as I know.
> If not I'll submit a feature request.
I suggest making the default: label with attribute((unused)) would be
a reasonable way to tell the compiler that (i) the default is not
supposed to be used very often (which helps us get better code from
basic-block reordering and branch probability analysis) and (ii) it's
there just to catch erroneous cases, so the compiler should still warn
if any of the enum members doesn't have a corresponding case. Hmm,
but perhaps this is overloading attribute((unused)) too much?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me