how to kernel printf a int64_t?
Julian Elischer
julian at freebsd.org
Sun Nov 2 01:23:15 UTC 2014
On 10/31/14, 1:09 PM, Tim Kientzle wrote:
> On Oct 30, 2014, at 2:01 PM, Rick Macklem <rmacklem at uoguelph.ca> wrote:
>
>> Hi,
>>
>> I feel kinda dumb asking this, but...
>> int64_t i;
>>
>> printf("%qd\n", (u_quad_t)i);
>>
>> works but looks dorky, to put it technically;-).
>> Is there a better way to printf() a int64_t in the kernel?
> I often use the following to print large integers:
>
> printf(“%jd\n”, (intmax_t)i);
the "cannonical' way is to use PRIu64 and friends, but some people
seem to have a problem with doing that.
>
> Tim
>
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>
>
More information about the freebsd-hackers
mailing list