Re: How to printk/sprintf uint64_t on Sparc without format and argument types mismatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vladislav Bolkhovitin <vst@xxxxxxxx>
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Η+?·???­?+%?Λ?±ιέΆ??w?Ί{.nΗ+?·¬??ά?)ξΗψ§Ά?ʽά¨}©?²Ζ zΪ&j:+v?¨ώψ―ω?w?ώ?ΰ2?ή?¨θ­Ϊ&ʼ)ίʽ«aΆΪ??ϋΰzΏδzΉή?ϊ+?ω???έʼj??wθώf



[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux