mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: vst@vlnb.net
Cc: sparclinux@vger.kernel.org, simone.ricci@gmail.com,
	scst-devel@lists.sourceforge.net, jeykholt@cisco.com,
	linux-kernel@vger.kernel.org
Subject: Re: How to printk/sprintf uint64_t on Sparc without format and argument types mismatch
Date: Wed, 16 Jun 2010 13:36:42 -0700 (PDT)	[thread overview]
Message-ID: <20100616.133642.112602306.davem@davemloft.net> (raw)
In-Reply-To: <4C192113.7030101@vlnb.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=iso-8859-7, Size: 764 bytes --]

From: Vladislav Bolkhovitin <vst@vlnb.net>
Date: Wed, 16 Jun 2010 23:08:03 +0400

> 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.

You must use %ll and explicitly cast the argument to "long long".
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

      parent reply	other threads:[~2010-06-16 20:36 UTC|newest]

Thread overview: 12+ 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:22   ` Kyle McMartin
2010-06-16 20:38     ` David Miller
2010-06-16 20:40       ` Kyle McMartin
2010-06-16 20:35   ` David Miller
2010-06-22 19:07     ` Vladislav Bolkhovitin
2010-06-22 19:35       ` Sam Ravnborg
2010-06-22 21:17         ` David Miller
2010-06-22 21:16       ` David Miller
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   ` Kyle McMartin
2010-06-16 20:36   ` David Miller [this message]

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=20100616.133642.112602306.davem@davemloft.net \
    --to=davem@davemloft.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 \
    --cc=vst@vlnb.net \
    /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

Powered by JetHome