Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ysub!fc138001 Organization: Youngstown State University VM system (YSUB) Date: Saturday, 8 Jun 1991 12:11:42 EDT From: Phil Munro Message-ID: <91159.121142FC138001@ysub.ysu.edu> Newsgroups: comp.lang.fortran Subject: More on EQUIVALENCE (and CHARACTER) Distribution: na References: <1991Jun1.171914.802@weyrich.UUCP> <1991Jun5.220805.4653@alchemy.chem.utoronto.ca> <1991Jun7.022834.898@weyrich.UUCP> <1991Jun7.144220.16691@alchemy.chem.utoronto.ca> > ... 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 The above discussion raises questions for me. Will the following code be portable? Might it cause problems on some compilers when trying to pick off part of whole and overlay storage? I know in the case of the VS compiler that character storage allows this sort of thing. character*14 whole character*4 part data whole /'part and so on'/ equivalence (whole,part) Or, here is another simpler example which I have used: character*8 blank8 character*4 blank equivalence (blank8,blank) data blank8 /' '/