This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Missing default in switch
- To: help-gcc at gnu dot org
- Subject: Re: Missing default in switch
- From: "T.E.Dickey" <dickey at clark dot net>
- Date: Wed, 20 Oct 1999 19:45:14 GMT
- Newsgroups: comp.lang.c,gnu.gcc.help,comp.std.c
- Organization: Clark Internet Services, Inc., Ellicott City, MD USA
- References: <7uhes4$12n$1@nnrp1.deja.com> <7uhfae$179$1@nnrp1.deja.com> <380DE980.20A6F404@tribble.com>
- Xref: wodc7nx0 comp.lang.c:19301 gnu.gcc.help:1494 comp.std.c:4759
In comp.std.c David R Tribble <david@tribble.com> wrote:
> Some compilers (and some lint programs) allow you to add a special
> comment where the missing default goes to indicate that the default
> case is omitted on purpose.
otoh, if you _do_ supply a 'default:', then some compilers will generate
more compact code (in addition to not warning about the missing case).
-- that's probably better than a comment...
--
Thomas E. Dickey
dickey@clark.net
http://www.clark.net/pub/dickey