Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!uunet!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.fortran Subject: Re: matrix multiplication Keywords: parameters, pass-by-value, pass-by-reference Message-ID: <3488@charon.cwi.nl> Date: 8 May 91 00:18:58 GMT References: <1991May04.170203.22222@ariel.unm.edu> <23261@lanl.gov> <1991May07.155218.13741@ariel.unm.edu> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 25 In article <1991May07.155218.13741@ariel.unm.edu> scavo@cie.uoregon.edu (Tom Scavo) writes: > So what is the concensus on this issue? Is it within the > standard to implement pass-by-value-result? If so, what > compilers have gone this route? I fail to see any difference between what Jim Giles said and what I said. Pass-by-value-result is allowed, as is pass-by-reference. The standard allows both. As I said, IBM compilers use pass-by-value-result, but CDC compilers use pass-by-reference. > > As an aside, how did it happen that two competing parameter > passing mechanisms got into the Fortran 77 standard? (This > question assumes, of course, that this is indeed the case.) This is indeed *not* the case. The standard simply leaves the parameter passing mechanisms unspecified. It only specifies the result for non-aliased parameters. Any program assuming one way or the other depends on improper aliasing, and that makes the program illegal. If you want a detour to Ada: in Ada it *is* specified that simple parameters are passed-by-value-return. Non-simple parameters are to be passed by either value-return or reference. The reason is that if the subroutine you are calling resides on a different processor you really *want* value-return in most cases. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl