From owner-freebsd-hackers Sun Nov 26 14:46:25 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id OAA08227 for hackers-outgoing; Sun, 26 Nov 1995 14:46:25 -0800 Received: from localhost.lightside.com (user42.lightside.com [198.81.209.42]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id OAA08217 for ; Sun, 26 Nov 1995 14:46:17 -0800 Received: (from jehamby@localhost) by localhost.lightside.com (8.6.12/8.6.9) id OAA00218; Sun, 26 Nov 1995 14:48:15 -0800 Date: Sun, 26 Nov 1995 14:47:50 -0800 (PST) From: Jake Hamby X-Sender: jehamby@localhost To: Terry Lambert cc: grog@lemis.de, terry@lambert.org, hackers@freebsd.org Subject: Re: How long is long? In-Reply-To: <199511261922.MAA15217@phaeton.artisoft.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org Precedence: bulk On Sun, 26 Nov 1995, Terry Lambert wrote: > > Let's clarify my perspective: > > If there is a type that is treated as atomic (ie: it may be used as > the underlying type for off_t according to ANSI and POSIX), then the > type promotion has to promote to the largest one allowable. The > target promoted type is, in fact, the stack alignment size. This > only makes sense, since the stack alignment size and single cycle > bus fetch and register sizes dictate the efficiency of the fetch > process. This is why Aztec on the Mac and Amiga 68k was correct > in setting sizeof(int) == 2 and Lattice (SAS) C was wrong in > setting sizeof(int) == 4. An "int" is supposed to be the "natural" > type for the machine and take a single bus cycle to load. I'd have to disagree with this particular statement. On the 680x0 series, it is correct to have sizeof(int) == 4, because these machines are fully 32-bit internally. Of course the 68000 and 68010 have a 16-bit data bus, but the 68020 and above have a 32-bit data bus. By saying that "int" should be the "natural" type for the machine, you are implying that, for example, "int" should be 16-bits on an 80386SX running FreeBSD (because it has a 16-bit bus) and 32-bits on 386DX and above!! Not that many people actually run FreeBSD on a 386SX :-) but you get the idea.. P.S. There is a compiler flag in SAS C on Amiga to set the default "int" size to 16 bits, if you so desire. How does that affect your philosophy? ------------------------------------------------------------------------------ Jake Hamby | E-Mail: jehamby@lightside.com Student, Cal Poly University, Pomona | System Administrator, JPL ------------------------------------------------------------------------------