Xref: utzoo comp.arch:20960 comp.lang.c:36272 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!brunix!cgy From: cgy@cs.brown.edu (Curtis Yarvin) Newsgroups: comp.arch,comp.lang.c Subject: Re: Whose code should we break? ( was Re: 64 bit C ) Message-ID: <65469@brunix.UUCP> Date: 19 Feb 91 18:57:37 GMT References: <1215@dms.UUCP> Sender: news@brunix.UUCP Reply-To: cgy@cs.brown.edu (Curtis Yarvin) Followup-To: comp.lang.c Distribution: comp.arch Organization: Brown University Department of Computer Science Lines: 31 In article <1215@dms.UUCP> albaugh@dms.UUCP (Mike Albaugh) writes: >From article , by marc@marc.watson.ibm.com (Marc Auslander): >> Anyone out there for sizeof int == 4? > > K&R defined 'int' to be the "natural" size for values that have >no particular size requirement, other than being "big enough" :-) Anyway, >because some yahoos decided that sizeof(int) == sizeof( char *) a _long_ >time ago, and because Motorola decided making the 68000 and "almost" 32-bit >machine, and because compiler vendors (perhaps justifiably) decided to make >sizeof(int) == 4 for the 68K, _I'm_ stuck porting a whole bunch of code >crawling with "register short i,j,k" to a 32-bit machine, whose compiler >obligingly does a truncate after every "++i" in a loop :-( I use "short" for integers on the 68k too. But "register short"? That's human error. The 68k does, after all, have 32-bit registers. > PLEASE DON'T LIE ABOUT THE SIZE OF YOUR INT. You will penalize >thoughtful competent programmers who thought about portability and growth >to reward lazy "all the world's a vax" (tm) hackers. I don't give a damn how big int is; I use int only when I don't care. But I want sizeof long == sizeof char *. There are quite a few applications in which I find myself writing my own memory manager; I need some type in which I can flick the bits on my pointers, portably. curtis "I tried living in the real world Instead of a shell But I was bored before I even began." - The Smiths