Newsgroups: comp.lang.fortran Path: utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!alchemy.chem.utoronto.ca!mroussel From: mroussel@alchemy.chem.utoronto.ca (Marc Roussel) Subject: Re: Pseudo-FORTRAN -- f2c for the Macintosh Message-ID: <1991Jun7.144220.16691@alchemy.chem.utoronto.ca> Organization: Department of Chemistry, University of Toronto References: <1991Jun1.171914.802@weyrich.UUCP> <1991Jun5.220805.4653@alchemy.chem.utoronto.ca> <1991Jun7.022834.898@weyrich.UUCP> Distribution: na Date: Fri, 7 Jun 1991 14:42:20 GMT In article <1991Jun7.022834.898@weyrich.UUCP> orville@weyrich.UUCP (Orville R. Weyrich) writes: >In article <1991Jun5.220805.4653@alchemy.chem.utoronto.ca> >mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes: >>I can see one possible legitimate use of EQUIVALENCE with different data >>types: to decide on the endianism of your machine (and similarly to decide >>other quirks of the number system of the computer). > >Of course, you beg the question. Why do you need to know the endianism if you >are writing standard FORTRAN? I feel that my point has been missed. A standard-conforming Fortran program doesn't need to know about endianism, of course. On the other hand, I believed when I wrote the above that it was possible to write a standard-conforming program whose sole purpose was to determine endianism. To what devious uses you put this information is in some sense irrelevant (and more than likely non-standard). It has struck me since however that since the standard doesn't say what to do when one equivalences across data types, a particularly odd compiler could transform the "obvious" meaning of EQUIVALENCE into something else entirely (and still conform to the standard). (I believe that this situation is common when equivalencing any numerical type to CHARACTER because of the peculiar way in which character variables are stored in some systems.) I therefore retract my example. I don't think you can use equivalence portably to do anything other than save space. Marc R. Roussel mroussel@alchemy.chem.utoronto.ca