Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!decwrl!sun!david From: david@sun.uucp (David DiGiacomo) Newsgroups: net.lang.c Subject: Re: Casting a postdecrement operand Message-ID: <3925@sun.uucp> Date: Wed, 4-Jun-86 16:00:39 EDT Article-I.D.: sun.3925 Posted: Wed Jun 4 16:00:39 1986 Date-Received: Fri, 6-Jun-86 04:49:26 EDT References: <114@romp.UUCP> <2842@utcsri.UUCP> <378@dg_rtp.UUCP> <1764@umcp-cs.UUCP> Organization: Sun Microsystems, Inc. Lines: 26 In article <1764@umcp-cs.UUCP> chris@maryland.UUCP (Chris Torek) writes: >Incidentally, if you really *do* want to take a pointer `p' to >type `x', but treat it as a pointer to type `y', the construct > > *(y **)&p > >works (as long as `p' is addressable). Thus > > ((struct abc *)cbap)++; > >is not legal, but > > (*(struct abc **)&cbap)++; > >is (again, if cbap is addressable). What it means is machine >dependent! This is disgusting... why not use cbap = (struct cba *) ((caddr_t) cbap + sizeof(struct abc)); ? -- David DiGiacomo {decvax, ihnp4, ucbvax}!sun!david david@sun.arpa Sun Microsystems, Mt. View, CA (415) 960-7495