Don> gcc allocates the following stack space for one local variable
Don> with a hard coded length that varies from 0 to 8:
Don> length bytes
Don> of local reserved
Don> variable by gcc
Don> -------- ---------
Don> 0
Don> 1 4
Don> 2 4
Don> 3 24
Don> 4 4
Don> 5 24
Don> 6 24
Don> 7 24
Don> 8 8
without seeing the actual code of the function, and the compiler options
used, there is no way to explain this. But consider that if optimisation
is enabled, gcc will use registers whenever possible, and the reserved
stack space may also be needed for temporary values, so a lot depends on
what the body of the function actually does (and what the actual type of
the variable is).
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>