From: donadio@isptechinc.com (Matthew Donadio)
Subject: Re: long long vs long
24 Jul 1998 00:29:17 -0700
Message-ID: <35B74D7E.5FB2.cygnus.gnu-win32@isptechinc.com>
References: <199807221508.LAA12504@alcove.wittsend.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: "Michael H. Warfield" <mhw@alcove.wittsend.com>
Cc: gnu-win32@cygnus.com

Michael H. Warfield wrote:
> Unfortunately the standard also specifies the length of several
> types.  Specifically char is 8 bits, short is 16 bits, and long is 32 bits.

Not to be picky, but to quote K&R II pg. 36:

"Each compiler is free to choose appropriate sizes for its own hardware,
subject only to the restriction that shorts and ints are at least 16
bits, longs are at least 32 bits, and short is no longer than int, which
is no longer than long."

Also, chars are not limited to be only 8 bits, but they must be at least
8 bits.  I routinely work on processors (C40, C44) where CHAR_BIT is
32.  This results in the pecularity that 

	sizeof(char) = sizeof(long) = 1

which is perfectly legal.  I think there is a lot more code in the world
that asumes that CHAR_BIT is 8 than sizeof(long) is 4.

-- 
Matt Donadio (donadio@isptechinc.com) | 43 Leopard Rd, Suite 102
Sr. Software Engineer                 | Paoli, PA 19301-1552
Image & Signal Processing, Inc.       | Phone: +1 610 407 4391
http://www.isptechinc.com             | FAX:   +1 610 407 4405
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
