Xref: utzoo comp.lang.c:5857 comp.lang.fortran:323 Path: utzoo!mnetor!uunet!husc6!rutgers!lll-lcc!ames!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c,comp.lang.fortran Subject: Re: Fortran arguments Message-ID: <9957@mimsy.UUCP> Date: 26 Dec 87 08:35:39 GMT References: <485@cresswell.quintus.UUCP> <1453@cuuxb.ATT.COM> <9934@mimsy.UUCP> <2068@ttrdc.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 21 In article <2068@ttrdc.UUCP>, levy@ttrdc.UUCP (Daniel R. Levy) writes: >UNIX f77 uses pass-by-address for FORTRAN parameter passing, but still >implements a copy-in copy-out scheme where this would make a difference >(i.e., where an operation is not atomic, as for arithmetic on complex >numbers). This is more a `happy accident of generating better code' than an attempt to protect against programmer blunders. Change your second routine to subroutine multc(c1,c2,c3,c4) complex c1, c2, c3, c4 c3 = c1 * c2 c4 = c1 * c3 return end and note that if `c1' and `c3' denote the same variable, the second expression effectively stores (c1 * c2) ** 2 in c4. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris