Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!skipper!elxsi!maine From: maine@elxsi.dfrf.nasa.gov (Richard Maine) Newsgroups: comp.lang.fortran Subject: Re: Type punning in FORTRAN (was in C) Message-ID: Date: 16 Oct 89 15:59:03 GMT References: <475@idacrd.UUCP> <1989Oct10.185851.6490@agate.berkeley.edu> <1989Oct11.091619.18336@gdt.bath.ac.uk> <1654@l.cc.purdue.edu> <1989Oct13.090311.9760@gdt.bath.ac.uk> <1874@sunset.MATH.UCLA.EDU> <1131@mpx1.lanl.gov> Sender: news@skipper.dfrf.nasa.gov Organization: NASA Dryden, Edwards, Cal. Lines: 26 In article <1131@mpx1.lanl.gov> matthias@mpx1.lanl.gov (Bjorn E. Matthias, M/S H831, 7-6241 or 7-7906) writes: >> [.. cited discussion of F8x TRANSFER intrinsic ..] > If I am not mistaken, then this could be previously accomplished in > VAX FORTRAN with EQUIVALENCE between two variables of whatever types. > I have used this often and it appears that TRANSFER is different only > in that one truly has *two* pieces of data, two memory locations. > Sounds like a useful function, though I do not believe it really > introduces a "new" feature. > Forgive me if I am stating what is obvious to all others. The thing that is new about it is that it is "standard" (insomuch as such a representation-specific thing can be). I can't think of any F77 compiler that doesn't allow you to play simillar tricks with equivalence (albeit sometimes a bit buggy when optimized). This discussion was about what was standard and/or "safe". I don't think that really "new" features were implied. Also, by doing this through an intrinsic function instead of by an equivalence, the nature of what is going on is much more obvious, both to the human reader and to the optimizing compiler. -- Richard Maine maine@elxsi.dfrf.nasa.gov [130.134.1.1]