From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 31 00:53:57 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 A59A57CB for ; Fri, 31 Oct 2014 00:53:57 +0000 (UTC) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 87BE3BEC for ; Fri, 31 Oct 2014 00:53:57 +0000 (UTC) Received: from marvin.lab.vangyzen.net (c-24-125-214-90.hsd1.va.comcast.net [24.125.214.90]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 382D156467; Thu, 30 Oct 2014 19:53:50 -0500 (CDT) Message-ID: <5452DD9D.6060508@vangyzen.net> Date: Thu, 30 Oct 2014 20:53:49 -0400 From: Eric van Gyzen User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Rick Macklem , Freebsd hackers list Subject: Re: how to kernel printf a int64_t? References: <439339249.2551223.1414702876172.JavaMail.root@uoguelph.ca> In-Reply-To: <439339249.2551223.1414702876172.JavaMail.root@uoguelph.ca> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Fri, 31 Oct 2014 00:53:57 -0000 On 10/30/2014 17:01, Rick Macklem wrote: > 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? The ANSI C way would be: #include int64_t i; printf("%"PRId64"\n", i); It's probably bad form to directly #include a file name with an underscore into an implementation file, but I don't see any other way. Maybe we could create a that #includes the necessary files to be a kernel equivalent of . Eric