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

Tao Ma tao.ma at oracle.com
Thu Mar 27 19:14:24 PDT 2008



Joel Becker wrote:
> On Thu, Mar 27, 2008 at 03:29:02PM +0800, Tao Ma wrote:
>> On x86_64, when print a __u64 by using PRIu64, gcc throw a warning:
>> warning: format ‘%lu’ expects type ‘long unsigned int’,
>> but argument 4 has type ‘__u64’.
>> It seems that __u64 is a long int, uint64_t a long long int and
>> PRIu64 "llu". So __u64 is not compatible with PRIu64, even though
>> it is a 64bit value.
> 
> 	Where are you seeing this?  On my local machines, PRIu64 on
> 64bit is "lu".
> 
Yes, PRIu64 is "lu", uint64_t is long unsigned int, but __u64 isn't.
So we can print uint64_t by using "PRIu64", but we can't do this for 
__u64 when we want to print any data defined as "__le64" in ocfs2_fs.h.

It seems that my commit log is somewhat wrong. Sorry for that.
I will resend the patch.
> Joel
> 
> 



More information about the Ocfs2-tools-devel mailing list