Declarations in switches, errors
bob larson
blarson at basil.usc.edu
Sun Oct 1 05:32:45 AEST 1989
>In article <1989Sep30.052000.13719 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>>Such
>>initializers *do* *not* get executed in any conforming implementation.
In article <30540 at news.Think.COM> barmar at kulla (Barry Margolin) writes:
>Well, since the initial value of automatic variables is undefined, a
>conforming implementation COULD execute them.
It COULD NOT execute any of the side effects the initializers have, however.
A compiler that recognises this case should IMHO just give a warning.
I have ported megabytes of net code to a machine that does not generate
correct code for any declarations in a switch statement block, (code to
adjust the stack is generated where it is never executed) and have found
only one program where this is a problem. (C-kermit, the current beta
has this fixed.)
--
Bob Larson Arpa: blarson at basil.usc.edu
Uucp: usc!basil!blarson
More information about the Comp.std.c
mailing list