From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public From: Charles Hixson Subject: Re: Mixing declarations and statements (Re: Porting (was ADA and Pascal etc)) Date: 1997/11/04 Message-ID: <345F6265.A505E2FC@earthling.net>#1/1 X-Deja-AN: 287020701 References: <34557f2b.1934172@news.mindspring.com> <63d5l4$tub$1@helios.crest.nt.com> <878495810snz@genesis.demon.co.uk> <63nlk6$h0e$1@darla.visi.com> Organization: Zippo News Service [http://www.zippo.com] Newsgroups: comp.lang.ada,comp.lang.c Date: 1997-11-04T00:00:00+00:00 List-Id: Peter Seebach wrote: /* snip */ > > >That's terrible programming practice of > >course because you're having the meaning of one switch case depend on > >the way another one was written. > Actually, I believe that it's worse than that. The variables are allocted at run time, so if the first case doesn't end with a break, then if you follow the path through the first case, then the second case MUST NOT declare the int, but only use it. However if you follow the path directly through the second case, then the second case MUST delcare the int. And this can only be detected at run-time (I hope I'm wrong about this. It's been a few of years since I did any significant amout of C programming, and I stayed away from this kind of construct then, but that's the way I remember it). -- Charles Hixson charleshixson@earthling.net (510) 464-7733 or chixso@mtc.dst.ca.us