From owner-freebsd-arch Tue Oct 8 18:22:40 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C67737B401 for ; Tue, 8 Oct 2002 18:22:39 -0700 (PDT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4782543E75 for ; Tue, 8 Oct 2002 18:22:38 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 6837 invoked from network); 9 Oct 2002 01:22:39 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 9 Oct 2002 01:22:39 -0000 Received: from laptop.baldwin.cx (laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id g991Man5007959; Tue, 8 Oct 2002 21:22:36 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20021008203120.K97120@espresso.q9media.com> Date: Tue, 08 Oct 2002 21:22:40 -0400 (EDT) From: John Baldwin To: Mike Barcroft Subject: Re: lp64 vs lp32 printf Cc: freebsd-arch@freebsd.org, Andrew Gallatin Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 09-Oct-2002 Mike Barcroft wrote: > Andrew Gallatin writes: >> >> What's the accepted way to printf something (like sizeof()) which >> boils down to "unsigned int" on x86 and "unsigned long" on the LP64 >> platforms? > > In userland you can use %z for printing size_t's. In the kernel, > casting to intmax_t/uintmax_t and using %j is correct. We could add '%z' to the kernel and change whatever hack %z DDB is using in db_printf() to be some other letter. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message