When is a cast not a cast?

Greg Hennessy gsh7w at astsun1.acc.Virginia.EDU
Fri May 19 02:19:27 AEST 1989


In article <334.nlhp3 at oracle.nl> bengsig at oracle.nl (Bjorn Engsig) writes:
#Pointer addition IS meaningless.  Let's take an example of a 3 bit machine
#with only 0, 1, 2, ... , 7 as the only addresses.  Let's also declare
#
#char *p, *q;
#
#and let p==3 and q==5.  Then what is p+q?  Which type does it have?  The
#presumed answer of '8' cannot be stored in this machine.
#

Then why can't one say "Integer addition IS meaningless. Let's take an
example of a 16 bit machine. Let's also declare

int i,j;

and let i == 32000 and q == 32767. Then what is I+j? Which type does
it have? The presumed answer of `64767' cannot be stored in this
machine. 

-Greg Hennessy, University of Virginia
 USPS Mail:     Astronomy Department, Charlottesville, VA 22903-2475 USA
 Internet:      gsh7w at virginia.edu  
 UUCP:		...!uunet!virginia!gsh7w



More information about the Comp.lang.c mailing list