Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: compilers and linkers Message-ID: <6715@brl-smoke.ARPA> Date: Sun, 22-Nov-87 22:39:40 EST Article-I.D.: brl-smok.6715 Posted: Sun Nov 22 22:39:40 1987 Date-Received: Wed, 25-Nov-87 19:48:29 EST References: <33890@sun.uucp> <387@sdcc15.UUCP> <180@sdti.UUCP> <11772@orchid.waterloo.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 27 In article <11772@orchid.waterloo.edu> atbowler@orchid.waterloo.edu (Alan T. Bowler [SDG]) writes: >As far as I know, the statement that ALL >Fortran compilers pass parameters by address is true. Try the following experiment: PROGRAM TEST LOGICAL FUNC INTEGER I DO 10 I = 1, 2 10 WRITE (*,*) FUNC(3) END LOGICAL FUNCTION FUNC(K) INTEGER K IF (K .EQ. 3) THEN K = 5 FUNC = .TRUE. ELSE FUNC = .FALSE. ENDIF END If all parameters are truly passed by address, then the constant "3" would be changed for I.EQ.1 and therefore the second invocation of FUNC would return .FALSE. In fact, this did happen for many older implementations of FORTRAN! I doubt that it happens for any current FORTRAN-77 implementation. This somehow no longer seems like a comp.lang.c issue..