Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c Subject: Re: Duff's device Message-ID: <718@proxftl.UUCP> Date: 7 Sep 88 14:25:41 GMT References: <32941@cca.CCA.COM> Reply-To: bill@proxftl.UUCP (T. William Wells) Organization: Proximity Technology, Ft. Lauderdale Lines: 22 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <32941@cca.CCA.COM> g-rh@CCA.CCA.COM (Richard Harter) writes: : Now all us good children know that when we write a loop with conditionals : the compiler does some magic for us -- it creates some labels and transfers : and tests and maybe does some block allocation. And it is incumbent upon : us not to confuse the compiler. If I declare some variables at the start : of the loop are they going to be there when I jump into the middle? This : is the sort of code that you have to be a language lawyer to be sure that : it works right -- and you have to assume that the compiler writer was a : good language lawyer too. I don't like to write code that requires being : a language lawyer to read and verify; life is too short. Pardon, but the question of what happens to local variables when entering a loop from other than the top has never been an obscure issue in C. Both K&R and ANSI assert that the locals will *not* be initialized, and K&R implies and ANSI explicitly states that the memory for the locals will be allocated. I also don't know of any compiler that fails to allocate space in this situation. Does anyone know of any? --- Bill novavax!proxftl!bill