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>
Matthew Wilcox wrote:
>
> So ... given all this, why do we define s64 to be 'long' on some
> architectures and 'long long' on others? It seems to actively _hinder_
> passing it to printf(), so there must be some other good reason that
> I'm missing to not make it 'long long' everywhere.
>

Well, compatibility with userspace is probably one aspect of that.
x86-64 is the odd man out there, it defines __s64 as "long long" even
for userspace, even though int64_t from <stdint.h> is "long". This,
IMO, is the Wrong Thing, but it's a separate set of changes.

The right thing to do is probably to always use "long long" in the
kernel, while defining __s64 et al as "long" on 64-bit platforms when
not under __KERNEL__.

Again, this is a separate set of changes from this patchset, which is
just a code transformation.

-hpa



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