lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 16 Jun 2010 13:36:42 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	vst@...b.net
Cc:	sparclinux@...r.kernel.org, simone.ricci@...il.com,
	scst-devel@...ts.sourceforge.net, jeykholt@...co.com,
	linux-kernel@...r.kernel.org
Subject: Re: How to printk/sprintf uint64_t on Sparc without format and
 argument types mismatch

From: Vladislav Bolkhovitin <vst@...b.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".

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ