u64 vs %llu format

From: Grant Grundler <iod00d_at_hp.com>
Date: 2004-02-12 05:17:30
Hi David, et al,

Why is __u64 defined as "unsigned long" and not "unsigned long long"?

I ask because:
	u64 i;
	...
	printk("i %llu\n, i);

will generate this warning:
<file>:<line>: warning: long long unsigned int format, __u64 arg (arg 2)

The code is correct, but the warning is "wrong".
(It might be technically correct, but doesn't flag a problem).
ia64 compiler could equate "long long" and "long" types or
the kernel could define __u64 as "unsigned long long".

The code above could cast "(unsigned long long) i" but it seems
silly this would be necessary. Maybe that's the right (but ugly) way.
Or is there a different printk format the code should be using?

Survey of other arches shows several use "unsigned long" for __u64
and I'm wondering if someone knows how this issue was resolved
in those arches:
asm-alpha/types.h:typedef unsigned long __u64;
asm-ia64/types.h:typedef unsigned long __u64;
asm-mips/types.h:typedef unsigned long __u64;
asm-ppc64/types.h:typedef unsigned long __u64;
asm-s390/types.h:typedef unsigned long __u64;
asm-sparc64/types.h:typedef unsigned long __u64;

Note that parisc uses "unsigned long long" for both 32 and 64-bit kernels.

thanks,
grant
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Feb 11 13:16:28 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:22 EST