Path: utzoo!attcan!uunet!wuarchive!gem.mps.ohio-state.edu!apple!usc!basil.usc.edu!blarson
From: blarson@basil.usc.edu (bob larson)
Newsgroups: comp.std.c
Subject: Re: Declarations in switches, errors
Message-ID: <20222@usc.edu>
Date: 30 Sep 89 19:32:45 GMT
References: <561@crdos1.crd.ge.COM> <11158@smoke.BRL.MIL> <637@crdos1.crd.ge.COM> <1989Sep30.052000.13719@utzoo.uucp> <30540@news.Think.COM>
Sender: news@usc.edu
Reply-To: blarson@basil.usc.edu (bob larson)
Organization: USC AIS, Los Angeles
Lines: 20

>In article <1989Sep30.052000.13719@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>>Such
>>initializers *do* *not* get executed in any conforming implementation.

In article <30540@news.Think.COM> barmar@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@basil.usc.edu
Uucp: usc!basil!blarson