Xref: utzoo comp.lang.c:22728 comp.lang.fortran:2571 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!deimos.cis.ksu.edu!harris.cis.ksu.edu!mac From: mac@harris.cis.ksu.edu (Myron A. Calhoun) Newsgroups: comp.lang.c,comp.lang.fortran Subject: Re: Type punning in C Keywords: I AGREE! Message-ID: <4055@deimos.cis.ksu.edu> Date: 12 Oct 89 13:10:38 GMT References: <475@idacrd.UUCP> <1989Oct10.185851.6490@agate.berkeley.edu> <1989Oct11.091619.18336@gdt.bath.ac.uk> <1654@l.cc.purdue.edu> Sender: news@deimos.cis.ksu.edu Reply-To: mac@harris.cis.ksu.edu (Myron A. Calhoun) Followup-To: comp.lang.c Organization: Kansas State University, Dept of Computing & Information Sciences Lines: 30 In article <1654@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes: >In article <1989Oct11.091619.18336@gdt.bath.ac.uk>, exspes@gdr.bath.ac.uk (P E Smee) writes: >> In article <1989Oct10.185851.6490@agate.berkeley.edu> jerry@violet.berkeley.edu ( Jerry Berkman ) writes: >< >Why not use equivalence? [several lines deleted] >> Problem is, the Fortran standard *also* says that if your program tries... [several lines deleted] >This is another example of those "gurus" who can not envision an intelligent >user using the machine in an intelligent manner, and prevent that use. I >have deliberately used "type punning" on various machines, and I consider it >an extremely useful tool..... [several lines deleted] I agree wholeheartedly. FORTRAN doesn't have PL/1's UNSPEC verb, yet I have had occasion to want it. And EQUIVALENCE provided it. Calling a subroutine with "wrong" type parameters can also work: CALL NEWTYP (INTEGER,...) ::::: SUBROUTINE NEWTYP (REAL,...) --Myron -- Myron A. Calhoun, PhD EE, W0PBV, (913) 532-6350 (work), 539-4448 (home). INTERNET: mac@ksuvax1.cis.ksu.edu BITNET: mac@ksuvax1.bitnet UUCP: ...{rutgers, texbell}!ksuvax1!harry!mac