Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!johnl From: johnl@ima.ima.isc.com (John R. Levine) Newsgroups: comp.lang.fortran Subject: Re: compiling equivalence statements ... Summary: RTFX3.9-1978 Message-ID: <4129@ima.ima.isc.com> Date: 30 Jun 89 01:59:20 GMT References: <2679@cveg.uucp> <4128@ima.ima.isc.com> <14674@ut-emx.UUCP> Reply-To: johnl@ima.UUCP (John R. Levine) Distribution: usa Organization: Segue Software, Inc. Lines: 26 In article <14674@ut-emx.UUCP> chpf127@ut-emx.UUCP (John W. Eaton) writes: >In article <4128@ima.ima.isc.com>, (John R. Levine) writes: >> dimension stf (12,3) >> dimension xstf (12*3) >> equivalence (stf,xstf) >> equivalence (is1,xstf(3)) > >Yikes! There's no need for extra storage here, ... Extra storage? Who's using extra storage? I'm using equivalence statements. The array xstf exists only so that the compiler will figure out the subscripts rather than trying to do it manually. >Also, if is1 is of type integer and stf is of type real, this program >is not strictly legal, ... On the contrary, it is entirely legal. The F77 standard states that real and integer variables are the same size and you are allowed to equivalence them together. The result of storing into a location as an integer and reading it back as a real is undefined, but so long as you keep your types straight, it's perfectly legal and portable. Equivalencing character and arithmetic types is a different issue, but we've heard plenty about that. -- John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 492 3869 { bbn | spdcc | decvax | harvard | yale }!ima!johnl, Levine@YALE.something Massachusetts has 64 licensed drivers who are over 100 years old. -The Globe