Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site faron.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!linus!faron!bs From: bs@faron.UUCP (Robert D. Silverman) Newsgroups: net.lang.c Subject: Re: Brain Damage Message-ID: <403@faron.UUCP> Date: Fri, 29-Nov-85 07:41:06 EST Article-I.D.: faron.403 Posted: Fri Nov 29 07:41:06 1985 Date-Received: Sun, 1-Dec-85 03:27:24 EST References: <133@brl-tgr.ARPA> Organization: The MITRE Coporation, Bedford, MA Lines: 38 > /* > > 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@nbs > */ > ------ *** REPLACE THIS LINE WITH YOUR MESSAGE ***