[Ocfs2-tools-devel] [PATCH 3/3] Suppress warning when print __u64 in X86_64.take 2

Tao Ma tao.ma at oracle.com
Tue Apr 1 19:22:48 PDT 2008


Sunil Mushran wrote:
> On ppc, ocfs2-tools are 32 bit. This is sort-of the convention
> in powerpc where userspace is 32-bit.
Really? I don't know that. ;)
But even if it is true, we meet with these warning when printing the 
ocfs2 disk information(such as ocfs2_dinode.i_blkno) which is defined as 
"__le64" and __le64 is defined as __u64. So this is 64 bit, right?


> 
> Tao Ma wrote:
>> Sunil,
>>     by now, I don't find a good way to resolve it on both powerpc and 
>> x86_64.
>>
>> PRIu64 is the same on 2 platforms.
>> # if __WORDSIZE == 64
>> #  define __PRI64_PREFIX        "l"
>> #  define __PRIPTR_PREFIX       "l"
>> # else
>> #  define __PRI64_PREFIX        "ll"
>> #  define __PRIPTR_PREFIX
>> # endif
>> So it should be "lu".
>>
>> while On x86_64,
>> in /usr/include/asm-x86_64/types.h:typedef unsigned long long  __u64;
>> And On powerpc
>> in /usr/include/asm/types.h:
>> #ifdef __powerpc64__
>> typedef __signed__ long __s64;
>> typedef unsigned long __u64;
>> #else
>>
>> __u64 is defined as 2 different types, so I don't know there is a way 
>> to suppress the warning on these 2 platforms except cast.
>>
>> If you think this solution isn't perfect, maybe I can leave it there 
>> and commit the other 2 patches.
>>
>> Regards,
>> Tao
>>
>> Sunil Mushran wrote:
>>  
>>> Thanks. It was getting painful to watch these warnings during builds.
>>>
>>> But am wondering if we can handle this without the way of casts



More information about the Ocfs2-tools-devel mailing list