This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wswitch and default case


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]