From owner-freebsd-hackers Fri Nov 24 11:10:54 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA14056 for hackers-outgoing; Fri, 24 Nov 1995 11:10:54 -0800 Received: from who.cdrom.com (who.cdrom.com [192.216.222.3]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA14042 for ; Fri, 24 Nov 1995 11:10:46 -0800 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by who.cdrom.com (8.6.12/8.6.11) with ESMTP id LAA04086 for ; Fri, 24 Nov 1995 11:10:44 -0800 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id MAA10078; Fri, 24 Nov 1995 12:05:45 -0700 From: Terry Lambert Message-Id: <199511241905.MAA10078@phaeton.artisoft.com> Subject: Re: How long is long? To: peter@taronga.com (Peter da Silva) Date: Fri, 24 Nov 1995 12:05:45 -0700 (MST) Cc: hackers@FreeBSD.ORG, terry@lambert.org In-Reply-To: <199511241510.JAA12572@bonkers.taronga.com> from "Peter da Silva" at Nov 24, 95 09:10:07 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1747 Sender: owner-hackers@FreeBSD.ORG Precedence: bulk > Terry Lambert wrote: > >That's a bug in the standard in not having mechanisms for obtaining > >sized types. For a 64 bit int (requiring a 64 bit long), short is > ^^-- 128 ^^^-- 64 The size of long shall be greater than or equal to the sizeof int. Your 128 says "greater than" and ignores "equal to". > >either 16 or 32 bits (undefined) and we lose access to either 32 or > >16 bit types (respectively). > > What architecture requires a 64 bit (int)? Any architecture where 64 bits is the bus transfer size and the registers are 64 bits or larger. It's defined as the "natural type" for the machine. But I was assuming a 64 bit int, and it was the int requiring the 64 bit long, not anything requiring a 64 bit int. My complaint is about the long >= int requirement on longs. > IMHO, DEC did exactly the right thing making int 32 bits and long 64 bits, > given the history of the language, but IMHO the original BSD port to the > VAX should have done the same thing, rather than keeping it 32 bits for > easier porting of PDP-11 code. > > Long doesn't and shouldn't mean "32 bits". Maybe not. But *something* should mean "32 bits". The problem is that with a 64 bit int (which, despite your opinion of DEC and grandfathering old software, is correct for the Alpha): int == 64 :== long == 64 short == 32 || short == 16 char == 8 You lose access to either 32 bit or 16 bit sized types. Period. What about existing on-disk data? ANSI doesn't allow "long long" or "quad". Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.