(someone wrote)
> My understanding is that the C standard calls for all parameters
> to be passed by value.  My experience is that IBM's C usually
> passes parameters by reference except that if a parameter is a
> pointer it gets passed by value.  Go figger.

That is most consistent with the way it was traditionally done.

The requirement is for "as if" to work.  It should be possible to
pass the addresses and the callee makes a local copy, or pass
addresses of copies.

The OS/360 Fortran compilers (G and H) make local copies of scalar
variables, and then copy them back before return.  (Usually
described as call by value result.)  That is legal Fortran.

For a Fortran call, local variables will have compile time
(relocatable) address constants, but dummy arguments arrays
will use the address passed in with the call.

PL/I passes the address of a temporary variable for expression
arguments, or arguments known to have different attributes.

To be most consistent with the OS/360 calling conventions,
as a series of A-type address constants, the last with the high
bit set, one would either pass addresses of copies, or expect
the called routine to make copies.  That would allow for calls
between C and other languages.

-- glen

Reply via email to