Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!helios!bcm!shell!shell!rjohnson From: rjohnson@shell.com (Roy Johnson) Newsgroups: comp.lang.c Subject: Re: increment casted void pointer -- ANSI? Message-ID: Date: 28 Mar 91 17:27:05 GMT References: <4142@rwthinf.UUCP> <1991Mar8.165300.11692@zoo.toronto.edu> <288@nazgul.UUCP> <15589@smoke.brl.mil> Sender: usenet@shell.shell.com (USENET News System) Organization: Shell Development Company, Bellaire Research Center, Houston, TX Lines: 39 In-Reply-To: gwyn@smoke.brl.mil's message of 26 Mar 91 22:22:11 GMT In article <15589@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: > In article <288@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes: > -In article <1991Mar8.165300.11692@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: > -The usual to do a 'type paint', which is to change the type of an object > -without changing the bit pattern, is to: > - *(newtype *)&(object) > A strictly conforming method is to use a union type. So can you do otype object; newtype feech; feech = ((union { newtype n; otype o;})object).n; or union { newtype n; otype o; } typeunion; feech = ((union typeunion)object).n; or do you have to do union typeunion blah; blah.o = object; feech = blah.n; ? Just what can we get away with, here? -- ======= !{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!rjohnson ======= Feel free to correct me, but don't preface your correction with "BZZT!" Roy Johnson, Shell Development Company