return(struct) implementation

Henry Spencer henry at utzoo.uucp
Tue Mar 14 02:41:06 AEST 1989


In article <42110 at clyde.ATT.COM> feg at clyde.ATT.COM (Forrest Gehrke) writes:
>> Just about every permutation of putting it on the stack is probably
>> in use in some compiler or other.  Probably the best approach, although
>> it's one that requires correct declaration, is to have the caller pass
>> in a pointer (as an invisible extra parameter) to where he wants the
>> return value put...
>
>I don't understand how a programmer calls a function and passes
>an "invisible extra parameter".  What device does he use to
>accomplish this? .....Or, are you talking about the compiler
>programmer?

The programmer has no say in the matter, any more than he has a say in how
a returned struct is put on the stack in an implementation that uses the
stack.  This is entirely the compiler's job.
-- 
Welcome to Mars!  Your         |     Henry Spencer at U of Toronto Zoology
passport and visa, comrade?    | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list