Stack frames

Andrew Koenig ark at alice.UucP
Fri Feb 14 13:26:44 AEST 1986


> In c one can declare variables within any {} block.  Does a
> {} pair *imply* new context, with stack frame shifts, etc.
> I would have to assume so if local variables are declared
> within the {} but if no variables are declared? ...

The semantics are as if the {} allocated a new stack frame,
but what actually happens is up to the compiler.  Every compiler
I have seen actually allocates stack memory only at entry to
a procedure, both for greater speed and in order to do the
right thing in case someone jumps into a "block".



More information about the Comp.lang.c mailing list