This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warning elimination patches in cp/call.c
- To: schmid at ltoi dot iap dot physik dot tu-darmstadt dot de (Peter Schmid)
- Subject: Re: Warning elimination patches in cp/call.c
- From: Tim Hollebeek <tim at wagner dot princeton dot edu>
- Date: Mon, 9 Mar 1998 18:08:49 -0500 (EST)
- Cc: egcs at cygnus dot com
Peter Schmid writes ...
>
> +
> + default:
> + break;
> +
Does this construct bother anyone else other than me? In some cases,
it is certainly the correct behavior (when a small number of cases are
handled explicitly, and the rest should be ignored) but if added too
often, it makes the warning it fixes completely useless, since that
particular switch() will no longer _ever_ warn about unhandled cases.
I'd rather see patches that add "case <unhandled enum> : break" after
determining that the value in question really shouldn't be handled.
"default: break" should only be added when the number of "case x :
break" statements gets large.
---------------------------------------------------------------------------
Tim Hollebeek | "Everything above is a true
email: tim@wfn-shop.princeton.edu | statement, for sufficiently
URL: http://wfn-shop.princeton.edu/~tim | false values of true."