This is the mail archive of the gcc-help@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]

Re: Missing default in switch


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


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