From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 2 01:46:33 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4CE240B; Sun, 2 Nov 2014 01:46:33 +0000 (UTC) Received: from mail.akips.com (mail.akips.com [65.19.130.19]) by mx1.freebsd.org (Postfix) with ESMTP id 904F620D; Sun, 2 Nov 2014 01:46:33 +0000 (UTC) Received: from akips.com (CPE-120-146-191-2.static.qld.bigpond.net.au [120.146.191.2]) by mail.akips.com (Postfix) with ESMTPSA id 0A71C16; Sun, 2 Nov 2014 11:46:25 +1000 (EST) Date: Sun, 2 Nov 2014 11:46:14 +1000 From: Paul Koch To: Julian Elischer Subject: Re: how to kernel printf a int64_t? Message-ID: <20141102114614.38aa9034@akips.com> In-Reply-To: <54558778.7050500@freebsd.org> References: <439339249.2551223.1414702876172.JavaMail.root@uoguelph.ca> <97A82163-E78D-457E-B649-B243B41A6C6F@kientzle.com> <54558778.7050500@freebsd.org> Organization: AKIPS X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on host1.akips.com X-Mailman-Approved-At: Sun, 02 Nov 2014 02:02:11 +0000 Cc: Freebsd hackers list X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 01:46:33 -0000 On Sun, 02 Nov 2014 09:23:04 +0800 Julian Elischer wrote: > On 10/31/14, 1:09 PM, Tim Kientzle wrote: > > On Oct 30, 2014, at 2:01 PM, Rick Macklem 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. We've always used the PRIxxx types when coding for both 32/64 platforms, but it would have been really nice to have a standard way for time_t. Something like PRItt Paul. -- Paul Koch | Founder, CEO AKIPS Network Monitor http://www.akips.com Brisbane, Australia