From: Vladislav Bolkhovitin <vst@vlnb.net>
To: sparclinux@vger.kernel.org
Cc: Simone Ricci <simone.ricci@gmail.com>,
scst-devel@lists.sourceforge.net,
Joe Eykholt <jeykholt@cisco.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: How to printk/sprintf uint64_t on Sparc without format and argument
Date: Wed, 16 Jun 2010 19:08:03 +0000 [thread overview]
Message-ID: <4C192113.7030101@vlnb.net> (raw)
In-Reply-To: <AANLkTimuv7nOlcGFxqPZlwcAjLmFMiLAvbA5O7F32Wbg@mail.gmail.com>
Hello,
We in SCST project need to printk/sprintf variables of type uint64_t.
Size of those variables is required to be 64-bit integer. On x86 we
printk/sprintf them as %lld, but on Sparc we have a compiler warnings like:
scst/src/scst_targ.c:2136: warning: format ‘%llx’ expects type ‘long
long unsigned int’, but argument 4 has type ‘uint64_t’.
It is because on Sparc uint64_t defined as unsigned long, but on x86 -
as unsigned long long.
Sure, we can cast all the cases to unsigned long long, but we wonder,
maybe there is a more elegant way to do that without the warning? For
instance, like %z for size_t or PRId64 in the user space.
Thanks,
Vlad
WARNING: multiple messages have this Message-ID (diff)
From: Vladislav Bolkhovitin <vst@vlnb.net>
To: sparclinux@vger.kernel.org
Cc: Simone Ricci <simone.ricci@gmail.com>,
scst-devel@lists.sourceforge.net,
Joe Eykholt <jeykholt@cisco.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: How to printk/sprintf uint64_t on Sparc without format and argument types mismatch
Date: Wed, 16 Jun 2010 23:08:03 +0400 [thread overview]
Message-ID: <4C192113.7030101@vlnb.net> (raw)
In-Reply-To: <AANLkTimuv7nOlcGFxqPZlwcAjLmFMiLAvbA5O7F32Wbg@mail.gmail.com>
Hello,
We in SCST project need to printk/sprintf variables of type uint64_t.
Size of those variables is required to be 64-bit integer. On x86 we
printk/sprintf them as %lld, but on Sparc we have a compiler warnings like:
scst/src/scst_targ.c:2136: warning: format ‘%llx’ expects type ‘long
long unsigned int’, but argument 4 has type ‘uint64_t’.
It is because on Sparc uint64_t defined as unsigned long, but on x86 -
as unsigned long long.
Sure, we can cast all the cases to unsigned long long, but we wonder,
maybe there is a more elegant way to do that without the warning? For
instance, like %z for size_t or PRId64 in the user space.
Thanks,
Vlad
next prev parent reply other threads:[~2010-06-16 19:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTimuv7nOlcGFxqPZlwcAjLmFMiLAvbA5O7F32Wbg@mail.gmail.com>
2010-06-16 19:05 ` Error "Unknown relocation: 36" on module load on Sparc Vladislav Bolkhovitin
2010-06-16 19:05 ` Vladislav Bolkhovitin
2010-06-16 19:22 ` Kyle McMartin
2010-06-16 19:22 ` Kyle McMartin
2010-06-16 20:38 ` David Miller
2010-06-16 20:38 ` David Miller
2010-06-16 20:40 ` Kyle McMartin
2010-06-16 20:40 ` Kyle McMartin
2010-06-16 20:35 ` David Miller
2010-06-16 20:35 ` David Miller
2010-06-22 19:07 ` Vladislav Bolkhovitin
2010-06-22 19:07 ` Vladislav Bolkhovitin
2010-06-22 19:35 ` Sam Ravnborg
2010-06-22 19:35 ` Sam Ravnborg
2010-06-22 21:17 ` David Miller
2010-06-22 21:17 ` David Miller
2010-06-22 21:16 ` David Miller
2010-06-22 21:16 ` David Miller
2010-06-16 19:08 ` Vladislav Bolkhovitin [this message]
2010-06-16 19:08 ` How to printk/sprintf uint64_t on Sparc without format and argument types mismatch Vladislav Bolkhovitin
2010-06-16 19:29 ` How to printk/sprintf uint64_t on Sparc without format and Kyle McMartin
2010-06-16 19:29 ` How to printk/sprintf uint64_t on Sparc without format and argument types mismatch Kyle McMartin
2010-06-16 20:36 ` How to printk/sprintf uint64_t on Sparc without format and David Miller
2010-06-16 20:36 ` How to printk/sprintf uint64_t on Sparc without format and argument types mismatch David Miller
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=4C192113.7030101@vlnb.net \
--to=vst@vlnb.net \
--cc=jeykholt@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=scst-devel@lists.sourceforge.net \
--cc=simone.ricci@gmail.com \
--cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.