From owner-freebsd-arch Tue Oct 8 17:38:46 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 8B25337B401 for ; Tue, 8 Oct 2002 17:38:45 -0700 (PDT) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3085543E4A for ; Tue, 8 Oct 2002 17:38:45 -0700 (PDT) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 7B92A9C0B; Tue, 8 Oct 2002 20:31:20 -0400 (EDT) Date: Tue, 8 Oct 2002 20:31:20 -0400 From: Mike Barcroft To: Andrew Gallatin Cc: freebsd-arch@freebsd.org Subject: Re: lp64 vs lp32 printf Message-ID: <20021008203120.K97120@espresso.q9media.com> References: <15779.30643.68675.577669@grasshopper.cs.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15779.30643.68675.577669@grasshopper.cs.duke.edu>; from gallatin@cs.duke.edu on Tue, Oct 08, 2002 at 08:26:27PM -0400 Organization: The FreeBSD Project 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 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. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message