lkml.org 
[lkml]   [2007]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Userspace compiler support of "long long"
Date
On Jun 27, 2007, at 20:30:42, Andi Kleen wrote:
> On Thursday 28 June 2007 00:30:52 Kyle Moffett wrote:
>> The only trick is if you care about building 32-bit compat code
>> using 64-bit linux kernel headers. In that case we should
>> probably just make all archs use "long long" for their 64-bit
>> integers, unless there's some platform I'm not remembering where
>> "long long" is 128-bits or bigger. The other benefit is that
>> people could then just use the printf format "%llu" for 64-bit
>> integers instead of having to conditionalize it all over the place.
>>
>> I'm working on a patch now.
>
> Changing this will give you a zillion warnings for printk formats.

Why? If this were a problem then we'd be getting a zillion warnings
*now* from all the 32-bit archs (which already use "long long" for 64-
bit. This would actually make it _easier_ to get the printk formats
right, as you could always use %ull for 64-bit types without having
to cast for 64-bit platforms.

This is another way to get around the "build 32-bit-compat userspace
on 64-bit kernel headers" problem: It tells GCC to use the
"smallest" available type of the given size, which ends up being
exactly the types we use now. On the other hand, it only works for
GCC which sort of ruins most of the reason for changing the types in
the first place.

typedef signed __s8 __attribute__((__mode__(__QI__)));
typedef unsigned __u8 __attribute__((__mode__(__QI__)));
typedef signed __s16 __attribute__((__mode__(__HI__)));
typedef unsigned __u16 __attribute__((__mode__(__HI__)));
typedef signed __s32 __attribute__((__mode__(__SI__)));
typedef unsigned __u32 __attribute__((__mode__(__SI__)));
typedef signed __s64 __attribute__((__mode__(__DI__)));
typedef unsigned __u64 __attribute__((__mode__(__DI__)));

Cheers,
Kyle Moffett

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-06-28 17:01    [W:0.110 / U:1.748 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site