From: Grant Grundler <iod00d@hp.com>
To: linux-ia64@vger.kernel.org
Subject: u64 vs %llu format
Date: Wed, 11 Feb 2004 18:17:30 +0000 [thread overview]
Message-ID: <20040211181730.GC10901@cup.hp.com> (raw)
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
next reply other threads:[~2004-02-11 18:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-11 18:17 Grant Grundler [this message]
2004-02-11 18:47 ` u64 vs %llu format David Mosberger
2004-02-11 19:26 ` Grant Grundler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040211181730.GC10901@cup.hp.com \
--to=iod00d@hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox