Brain Damage

Robert D. Silverman bs at faron.UUCP
Fri Nov 29 22:41:06 AEST 1985


> /*
> > The problem is really the brain damage among UNIX hackers that  assumes
> > sizeof(int) == sizeof (char *).  This is so painful to fix (for quick ports)
> > that although the 68000's int should be 16 bits (the size that works best,
> > fastest, ...) it is often made 32 bits.  While this avoids the pain for the
> > porter, it does lead to problems for the end user (i.e. using short vs int).
> > 
> > Rich Hammond    (ihnp4|allegra|decvax|ucbvax) !bellcore!hammond
> 
> Sorry, but some of us *like* it that way. The 68k is a 32 bit machine in
> spite of the fact that the bus is only 16 bits. 16 bit ints are stupid.
 
Sorry again but if you look closely at the way the 68000 does arithmetic
you quickly realize (not the 68020!!!) that it IS a 16 bit machine disguised
as a 32 bit machine. It WILL NOT do a 32 x 32 bit multiply (even ignoring
the upper 32 bits) not will it do a 32 / 32 bit divide!!. (say 28 bits / 20
bits will not work!). What generally happens (e.g. SUN's is that the compiler
when it sees: long a,b,c;  c = a/b; calls a built in routine to do the 
division. This, to my way of thinking is a machine which really only does
16 bit arithmetic. The 68010 may have 32 bit addressing and registers but
most instructions only operate on 16 bit quantities. You can't even shift
more than 16 bits or shift across register boundaries.

Bob Silverman
> And sizeof(int) should be sizeof(any *) on any machine possible. 
> Portability to lesser machines should be done *by the porter*. That's
> why they call it porting. After all, this is still easier to do than
> rewriting the program.
> 
> I can live with the new ANSI C recasting all my parameters for me.
> I refuse to cast parameters to the `correct' type. And I refuse to
> work on any machine where I need to. You want it, you fix it.
> 
> 	jim		cottrell at nbs
> */
> ------

*** REPLACE THIS LINE WITH YOUR MESSAGE ***



More information about the Comp.lang.c mailing list