Flex on MSDOS and C block structure
David Collier-Brown
daveb at geac.UUCP
Mon May 16 22:31:04 AEST 1988
In article <1988May15.002127.413 at utzoo.uucp> henry at 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
More information about the Comp.lang.c
mailing list