Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!necntc!ima!johnl From: johnl@ima.ISC.COM (John R. Levine) Newsgroups: comp.lang.fortran Subject: Re: Fortran follies Message-ID: <1028@ima.ISC.COM> Date: 19 May 88 02:00:17 GMT References: <5377@cup.portal.com> <50500052@uxe.cso.uiuc.edu> <705@thalia.rice.edu> Reply-To: johnl@ima.UUCP (John R. Levine) Organization: Not much Lines: 33 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) >> ... >Very common (probably essential to making libraries) but not legal; > >"15.9.3.6 Restrictions on Association 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. ... By my reading of the F77 standard, it's perfectly legal to pass disjoint chunks of an array to a subprogram as separate arguments. 2.14 says that association means that the same datum may be identified by different symbolic names. The discussion of association of storage sequences and entities in 17.1.2 and 17.1.3 makes it pretty clear that two arrays are associated iff their storage overlaps; in this case they don't so 15.9.3.6 doesn't apply. Intuitively, the restriction in 15.9.3.6 is intended to prohibit argument aliasing that would break calling sequences that copy in argument values at call time and copy changed results back before the return. In this case, even if the arrays were passed by copy/return (pretty unlikely for an array, but still legal) the code would still work. Scripturally yours, -- John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869 { ihnp4 | decvax | cbosgd | harvard | yale }!ima!johnl, Levine@YALE.something Rome fell, Babylon fell, Scarsdale will have its turn. -G. B. Shaw