Addresses of parameters

Richard A. O'Keefe ok at quintus.uucp
Wed Nov 2 12:50:19 AEST 1988


In article <1013 at teorix.liu.se> pausv at teorix.liu.se (Paul Svensson) writes:
>Yes, I agree with Barry that taking tha address of a parameter is not
>very useful, but that is NOT a good reason for not allowing it.
>There are other good reasons, such as making it easier to pass arguments
>in registers, for example. ... To allow "&" to work on parameters
>is essentially the same as to allow it to work on register variables,

All the compiler has to do if it sees & applied to an argument is to
spill that argument to memory and use the in-memory version.  Most of
the RISC machines I've looked at adopt a convention where non-scalar
and "excess" arguments are passed in a block on the stack, and gaps are
left for the arguments which are assigned to registers, so each argument-
in-a-register has a slot reserved for it in memory anyway.



More information about the Comp.lang.c mailing list