Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!tut.cis.ohio-state.edu!ucbvax!unisoft!hamish From: hamish@unisoft.UUCP (Hamish Reid) Newsgroups: comp.lang.c Subject: Re: When is a cast not a cast? Message-ID: <2052@unisoft.UUCP> Date: 18 May 89 19:34:00 GMT References: <2747@buengc.BU.EDU> <10191@smoke.BRL.MIL> <406@skye.ed.ac.uk> <10276@smoke.BRL.MIL> <2890@buengc.BU.EDU> Reply-To: hamish@unisoft.UUCP (Hamish Reid) Lines: 60 I can't stand it any longer... In article <2890@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes: > >>What properties does t hypothetically have? > >It has the property that you can now subtract > > char *pnew, *r; > pnew = t - r > >and expect pnew to point to the location referred to p that is >the same offset as q is referred to r. Let's try this just one more time (but see also my other posting answering Blair's more general points): Blair - what is the type of the result of subtracting one pointer from another? [Hint: it's not an address unless you cast it that way - and then it wouldn't in general be a meaningful address] - what is the *difference* between two pointers (a la subtraction)? [Hint: it's not an address unless you cast it that way - and then it wouldn't be a meaningful address] - what is the type of "t" above? [Hint: As the original poster (Tobin?) pointed out, it's not a char *, nor is it really well-defined).] >>[Doug Gwynn:] Other postings have explained why we don't think a reasonable, >>consistent model for this feature is possible. > >"Why we don't think...possible"?? Not only is it possible, it's sensible. >As to whether we think it is so, that is irrelevant. You might want to ponder who the "we" is above. Doug Gwynn and the rest of the Ansi C standards commitee? Concerned Citizens for C Programming Semantics (:-))? We poor folks in the C semantics and/or compiler-writing community? But gee, Blair Houghton (the original Man With The Pointer Scaling Problem) says it's possible, it's sensible, so it *must* be so. QED. RIP. Etc. >We don't think >fusion is possible, either, unless we consider that it's going on all >over the place (well, not _all_ over the place, but in all those jillions >of stars...!) Speak for yourself. That was the Royal "we", I presume? There's little else that would account for the imperiously ignorant tone of your posting... Hamish ----------------------------------------------------------------------------- Hamish Reid UniSoft Corp, 6121 Hollis St, Emeryville CA 94608 USA +1-415-420-6400 hamish@unisoft.com, ...!uunet!unisoft!hamish