From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 2 01:23:15 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 851B7F07 for ; Sun, 2 Nov 2014 01:23:15 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5044CFB1 for ; Sun, 2 Nov 2014 01:23:14 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-239-104.lns20.per1.internode.on.net [121.45.239.104]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id sA21NAEJ016786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 1 Nov 2014 18:23:13 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <54558778.7050500@freebsd.org> Date: Sun, 02 Nov 2014 09:23:04 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Tim Kientzle , Rick Macklem Subject: Re: how to kernel printf a int64_t? References: <439339249.2551223.1414702876172.JavaMail.root@uoguelph.ca> <97A82163-E78D-457E-B649-B243B41A6C6F@kientzle.com> In-Reply-To: <97A82163-E78D-457E-B649-B243B41A6C6F@kientzle.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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:23:15 -0000 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. > > 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" > >