Re: Data Types
- From: Dave Neary <dave neary palamon ie>
- To: Erik Mouw <J A K Mouw ITS TUDelft NL>
- Cc: Helmethead <hoshem mel comcen com au>, gtk-list gnome org
- Subject: Re: Data Types
- Date: Fri, 25 May 2001 11:51:02 +0100
Erik Mouw wrote:
>
> On Fri, May 25, 2001 at 01:19:20PM +1000, Helmethead wrote:
>
> Yes, because all 64 bit CPUs I know are RISC CPUs, they don't like
> anything else then their native format. So 64 bit CPUs want 64 bit
> variables (int is 64 bit), and 32 bit machines want 32 bit variables.
As a pedantic point, there's nothing in the C standard guaranteeing that
sizeof(int)==sizeof(int *) - CHAR_BIT*sizeof(int) is limited below by
32, and that's it. In fact, the sizes of the various types are compiler
dependant.
gcc defines short int as a 16-bit type, int as a 32 bit type, long int
as a 32 bit type and long long int (which is standard in C99) as it's 64
bit type. Regardless of the platform. Bottom line: int doesn't have to
be a 64-bit type on a 64-bit platform, although it can be, dependant on
the compiler.
> Erik
Cheers,
Dave.
--
David Neary, E-Mail dave neary palamon ie
Palamon Technologies Ltd. Phone +353-1-634-5059
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]