Path: utzoo!attcan!uunet!mcvax!ukc!cam-cl!am From: am@cl.cam.ac.uk (Alan Mycroft) Newsgroups: comp.lang.c Subject: Re: Union type conversions Message-ID: <231@gannet.cl.cam.ac.uk> Date: 23 Jun 88 15:05:22 GMT References: <5754@bloom-beacon.MIT.EDU> <1988Jun16.182158.2424@utzoo.uucp> Sender: news@cl.cam.ac.uk Reply-To: am@cl.cam.ac.uk (Alan Mycroft) Organization: U of Cambridge Comp Lab, UK Lines: 9 In article <1988Jun16.182158.2424@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >> So what it boils down to, is whether casting into a union type is >> legal and portable... > >No. You have to use the temporary union variable and assign to one of >its members, as in your second example. Yes, but have you ever seen a compiler which deals with this efficiently? (Not to mention the human overhead.)