From: donadio@isptechinc.com (Matthew Donadio)
Subject: Re: long long vs long
24 Jul 1998 23:08:58 -0700
Message-ID: <35B8C883.3AD9.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: Timothy Writer <Tim.Writer@ftlsol.com>
Cc: gnu-win32@cygnus.com

Timothy Writer wrote:
>     sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long)
> and
>     sizeof(char)  == 1
>     sizeof(short) >= 2
>     sizeof(int)   >= 2
>     sizeof(long)  >= 4

Not necessarilly.  By definition sizeof(char) is always 1 no matter what
CHAR_BIT is defined to be.  But the values for the other sizeof's are
not correct for all machines.

For example, on the TMS320C3x and TMS320C4x families, the minimum
addressable memory unit is 32 bits, so CHAR_BIT for this machine is 32. 
It also happens that all other intergral types (short, int, and long)
are 32 bits (the exact size of char), so

sizeof(char) == sizeof(short) == sizeof(int) == sizeof(long) == 1

Weird, but legal.

-- 
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".
