From owner-freebsd-current@FreeBSD.ORG Thu Jul 10 03:50:35 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D69CE106564A for ; Thu, 10 Jul 2008 03:50:35 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0C08FC1A for ; Thu, 10 Jul 2008 03:50:35 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id m6A3oUNK053273; Wed, 9 Jul 2008 21:50:31 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <48758706.6040900@samsco.org> Date: Wed, 09 Jul 2008 21:50:30 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: David Christensen References: <5D267A3F22FD854F8F48B3D2B52381932677CC83F1@IRVEXCHCCR01.corp.ad.broadcom.com> In-Reply-To: <5D267A3F22FD854F8F48B3D2B52381932677CC83F1@IRVEXCHCCR01.corp.ad.broadcom.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: "freebsd-current@freebsd.org" Subject: Re: Proper Printf Format for Printing Physical Addresses on 32 and 64 bit Systems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 03:50:35 -0000 David Christensen wrote: > I have some debugging code in my network driver and I'd like > to print out the physical address of a memory block. What's > the right way to use a printf() that works on both 32 and 64 > bit platforms? > > Dave > > Cast it to a uintmax_t and use %ju or %jx Scott