lkml.org 
[lkml]   [2008]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/24] types: create <asm-generic/int-*.h>


On Fri, 25 Apr 2008, Jan Engelhardt wrote:
>
> long long is 64 bits on both 32 and 64, is not it?
> If so, the split between 32 and 64 should not be necessary.

They may be the same size, but there are still pure C-level _type_
differences that the compiler will warn about.

This is the same issue as a 32-bit type on x86-32: is it an "int" or a
"long"? From a pure size perspective it shouldn't matter, but if you pass
a pointer to it, or use it in a "printf()", it matters a whole lot,
because the compiler will complain if you use the wrong version.

So on some 32-bit architectures, "size_t" is "unsigned int", on others it
is "unsigned long", and you have to get it right in order to avoid
complaints.

The exact same thing is true about "long" vs "long long" on 64-bit
architectures. They may have the same size, but they don't have the same
type.

Linus




\
 
 \ /
  Last update: 2008-04-25 20:39    [W:0.210 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site