return(struct) implementation

Marco Zagha marcoz at MARCOZ.BOLTZ.CS.CMU.EDU
Tue Mar 7 11:42:52 AEST 1989


Can anybody explain how returning a structure from a function is
typically implemented.  Assume it is too big to use registers.
Is it returned on the stack?  Where does the return structure
go in relation to parameters to the function?  For a stack that
grows downward, is the return value above the parameters,
below the parameters, or does the return statement overwrite
the parameters?

Since I suspect this is implementation dependent, please specify
what implementation you are describing.

== Marco (marcoz at cs.cmu.edu)

P.S. I am *not* writing any code that depends on the implementation.
I am just curious.
-- 



More information about the Comp.lang.c mailing list