Mail Archives: cygwin/1998/07/24/23:08:58
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 AT isptechinc DOT 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 AT cygnus DOT com" with one line of text: "help".
- Raw text -