Missing default in switch
T.E.Dickey
dickey@clark.net
Thu Oct 21 04:16:00 GMT 1999
In comp.std.c Mathew Hendry <scampi@dial.pipex.com> wrote:
>>otoh, if you _do_ supply a 'default:', then some compilers will generate
>>more compact code
> How? Adding an empty default doesn't change the meaning of the switch
> statement.
no - it doesn't change the meaning. But (MSVC is a good example), I've
observed that for some compilers, generating warnings seems to stop it from
going on to do additional type-checking and optimization (probably more
a characteristic of the programmer than the program ;-)
> MSVC supports
--
Thomas E. Dickey
dickey@clark.net
http://www.clark.net/pub/dickey
More information about the Gcc-help
mailing list