When is a cast not a cast?
Hamish Reid
hamish at unisoft.UUCP
Fri May 19 05:34:00 AEST 1989
I can't stand it any longer...
In article <2890 at buengc.BU.EDU> bph at 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 at unisoft.com, ...!uunet!unisoft!hamish
More information about the Comp.lang.c
mailing list