Path: utzoo!attcan!uunet!mcvax!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.fortran Subject: Re: Fortran follies Message-ID: <7550@boring.cwi.nl> Date: 18 May 88 23:08:20 GMT References: <5377@cup.portal.com> <50500052@uxe.cso.uiuc.edu> <705@thalia.rice.edu> Organization: CWI, Amsterdam Lines: 37 In article <705@thalia.rice.edu> david@titan.UUCP (David Callahan) writes: > In article <50500052@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: > > > > real x(100000) > > call sub(1000, x(1),x(10000),x(20000)) > > ... > > > > subroutine sub(n,x,y,z) > > dimension x(n), y(n), z(n) > >This had also better work. I THINK that it is even legal. > Very common (probably essential to making libraries) but not legal; > > "15.9.3.6 Restrictions on Assoication of Entities. If a > subprogram reference causes a dummy argument in the > referenced subprogram to become associated with another > dummy argument in the referenced subprogram, neither > dummy argument may become defined during execution of > that subprogram. For example, if a subroutine is headed by > SUBROUTINE XYZ(A,B) > and is referend by > CALL XYZ (C,C) > then the dummy arguments A and B each become associated > with the same acutal argument C and therefore with each other. > Neither A nor B may become defined during this execution > of the subroutine XYZ or by any procedure referend by ZYX." Yes, that is already in the Fortran 66 standard, but does not apply here. If a dummy argument is an array, the actual argument may be an array or an array element. Here we heve the letter case, and the three dummy arguments are not associated with the same actual arguments (those are not complete arrays but only sections). (The general restriction is that aliassing is prohibited for variables or array elements you are assigning to. Many optimizers rely on this.) -- dik t. winter, cwi, amsterdam, nederland INTERNET : dik@cwi.nl BITNET/EARN: dik@mcvax