Xref: utzoo comp.sources.d:2113 comp.lang.c:10137 Path: utzoo!yunexus!geac!daveb From: daveb@geac.UUCP (David Collier-Brown) Newsgroups: comp.sources.d,comp.lang.c Subject: Re: Flex on MSDOS and C block structure Keywords: nested declarations flex Message-ID: <2748@geac.UUCP> Date: 16 May 88 12:31:04 GMT Article-I.D.: geac.2748 Posted: Mon May 16 08:31:04 1988 References: <4060@killer.UUCP> <1988May15.002127.413@utzoo.uucp> Reply-To: daveb@geac.UUCP (David Collier-Brown) Organization: The Geac ICL Department. Lines: 17 In article <1988May15.002127.413@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >All definitions of C that I'm aware of make it quite clear that the values >of uninitialized local variables are unknown when the block containing >them is entered, *regardless* of whether the block was executed before and >gave them a value then. Old values go away when the block is exited. >... >Even if allocation is at function-entry time, clever compilers may well >re-use the space for something else after the block is exited. Specifically, I once saw a compiler re-use the recently-exited context for the stack frame of a subroutine call, and notice that a copy of a needed parameter value was laying around just where it would be needed in the call. So it didn't move it. (I've heard of register histories, but they must have been keeping top-of-stack histories to do that!) --dave