Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!ihlpb!TSfR!usenet From: usenet@TSfR.UUCP (usenet) Newsgroups: comp.lang.c Subject: Re: When is a cast not a cast? Summary: Whoa.. Message-ID: <546@TSfR.UUCP> Date: 18 May 89 05:52:39 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: orc@TSfR.UUCP (David L. Parsons) Followup-To: comp.lang.c Organization: This Space for Rent - Lisle, IL Lines: 45 Expires: In article <2890@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes: [more discussion of the properties of pointer+pointer] > >>What is its type hypothetically supposed to be? > >char * > >>What can one legally do with it? > >What one can legally do between (consenting) integers? Eeek. Hopefully not. If it's integerish, it associates & commutes, and if it's a pointer, well.... pointer-pointer yields an int replace a pointer with a pointer+pointer.... (pointer+pointer)-pointer yields an int then rearrange the parenthesis.... pointer+(pointer-pointer) yields an int you'd get (using pointer-pointer yields an int) ... pointer+int yields an int which conflicts with... pointer+int yields a pointer > ... Not only is it possible, it's sensible. Not really, not with the abilities you give it above. What does pointer+pointer give you, aside from clever loop optimizations? Wouldn't the task of loop optimizing be better served by making a type that holds pointer+pointer values and that can have a pointer subtracted from it to yield another pointer, but doesn't allow any other operation? -david parsons -orc@pell.uucp