Date: Sun, 02 Nov 2014 09:23:04 +0800 From: Julian Elischer <julian@freebsd.org> To: Tim Kientzle <tim@kientzle.com>, Rick Macklem <rmacklem@uoguelph.ca> Cc: Freebsd hackers list <freebsd-hackers@freebsd.org> Subject: Re: how to kernel printf a int64_t? Message-ID: <54558778.7050500@freebsd.org> In-Reply-To: <97A82163-E78D-457E-B649-B243B41A6C6F@kientzle.com> References: <439339249.2551223.1414702876172.JavaMail.root@uoguelph.ca> <97A82163-E78D-457E-B649-B243B41A6C6F@kientzle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/31/14, 1:09 PM, Tim Kientzle wrote:
> On Oct 30, 2014, at 2:01 PM, Rick Macklem <rmacklem@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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54558778.7050500>
