When it is amoral... (Re: When is a cast not a cast?)

Peter da Silva peter at ficc.uu.net
Mon May 8 22:42:22 AEST 1989


In article <925 at garcon.cso.uiuc.edu>, mcdaniel at uicsrd.csrd.uiuc.edu (Tim McDaniel) writes:
> Suppose that pointer addition means that "&A[i] + &A[j] == &A[i+j]".
> (Is this what you had in mind, Peter?)

No, I had in mind ((ptrdiff_t)&A[i]) - ((ptrdiff_t)&A[j]). It's an
intermediate result only. Which you point out in great detail.

> Peter, you can't just say "let there be pointer addition", and
>                          FIAT LUX!
> there is pointer addition, and it is good.  You have to propose an
> actual implementation.  Furthermore, if this implementation is more
> costly than the current situation, you have to show that the gains
> outweigh the costs.  You have done neither.

Chill out, dude :->.

I was arguing *against* it as a general operation. I was just noting that there
*is* (despite my previous beliefs) an application for it.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.

Business: uunet.uu.net!ficc!peter, peter at ficc.uu.net, +1 713 274 5180.
Personal: ...!texbell!sugar!peter, peter at sugar.hackercorp.com.



More information about the Comp.lang.c mailing list