home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] Double checking re: twos complement & signed types ??

  • Subject: Re: [OCLUG-Tech] Double checking re: twos complement & signed types ??
  • From: Bart Trojanowski <bart [ at ] jukie [ dot ] net>
  • Date: Wed, 19 Sep 2007 14:48:45 -0400
* Ross Jordan <rjordan [ at ] numb [ dot ] ca> [070919 14:29]:
> It would seem Bart Trojanowski, on Wed, Sep 19, 2007 at 02:07:24PM -0400, wrote:
> > * William Case <billlinux [ at ] rogers [ dot ] com> [070919 13:19]:
> > > > > 
> > > > > Given that I am using an AMD Athalon 64 x2 CPU:
> > > > > 
> > > And given that "sizeof(int)" returns 8 bytes or maximum of
> >                   ^^^^^^^^^^^^^^^^^^^^^^
> > 
> > I think you mean 4.  32bits.  On Linux int has always been 32bit.
> 
> On 64-bit machines (running in 64-bit mode), int should be 8 bytes, no?

Nope.  sizeof(int) is always 4 on Linux, as it is a LLP64 platform.

>> LLP64 model, which maintains compatibility with 32-bit code by
>> leaving both int and long as 32-bit. "LL" refers to the "long long"
>> type, which is at least 64 bits on all platforms, including 32-bit
>> environments.
    -- http://en.wikipedia.org/wiki/LLP64#64-bit_data_models

-Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/