[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: amd64: why is sizeof(int) =4? why not =8?



On Wed, Apr 05, 2006 at 06:48:29AM -0500, Mitchell Laks wrote:
> 
> Size of int is 4
> Size of int is 4
> Size of Employee is 44
> Size of john is 44
> Size of char is 1
> Size of short is 2
> Size of int is 4
> Size of long is 8
> Size of float is 4
> Size of double is 8
> 
> So how do I see the 64 bittness of the operating system if  not this way with 
> gcc? I would think tha size of int would be 8?

I think the AMD-64 hardware even requires an explicit length prefix on 
every 64-bit integer machine instruction; otherwise it's 32-bit.  
Addresses are different, and normally 64 bits.

So one answer might be, C is following the hardware's lead.

-- hendrik



Reply to: