Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!iuvax!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: call by address (was Re: compilers Message-ID: <47000023@uxe.cso.uiuc.edu> Date: Wed, 25-Nov-87 11:11:00 EST Article-I.D.: uxe.47000023 Posted: Wed Nov 25 11:11:00 1987 Date-Received: Sun, 29-Nov-87 18:02:41 EST References: <12114@think.UUCP> Lines: 24 Nf-ID: #R:think.UUCP:12114:uxe.cso.uiuc.edu:47000023:000:717 Nf-From: uxe.cso.uiuc.edu!mcdonald Nov 25 10:11:00 1987 In article <6715@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) writes: > 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 >This somehow no longer seems like a comp.lang.c issue.. This is not a C issue, but neither is it Fortran, as the example is not a legal Fortran program. Any possible run-time behaviour is possible: Fortran does not define it. The reason is that Fortran does not permit an actual argument (the "3" in FUNC(3) ) to be modified in FUNC (the K=5 line). It is up to the programmer not to write erroneous programs. (okay, I am wearing a flameproof suit) Doug McDonald