Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Nov 1995 14:47:50 -0800 (PST)
From:      Jake Hamby <jehamby@lightside.com>
To:        Terry Lambert <terry@lambert.org>
Cc:        grog@lemis.de, terry@lambert.org, hackers@freebsd.org
Subject:   Re: How long is long?
Message-ID:  <Pine.BSF.3.91.951126144020.207A-100000@localhost>
In-Reply-To: <199511261922.MAA15217@phaeton.artisoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
------------------------------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.951126144020.207A-100000>