From owner-freebsd-arch Wed Oct 9 14:23: 3 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 1CF0137B401; Wed, 9 Oct 2002 14:23:02 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.92.13.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 907BE43E3B; Wed, 9 Oct 2002 14:23:01 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.6/8.12.2) with ESMTP id g99LMw5b065548; Wed, 9 Oct 2002 14:22:58 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.6/8.12.5/Submit) id g99LMw9f065547; Wed, 9 Oct 2002 14:22:58 -0700 (PDT) Date: Wed, 9 Oct 2002 14:22:58 -0700 From: "David O'Brien" To: Peter Wemm Cc: Bruce Evans , Mike Barcroft , Andrew Gallatin , freebsd-arch@FreeBSD.ORG Subject: Re: lp64 vs lp32 printf Message-ID: <20021009212258.GA65457@dragon.nuxi.com> Reply-To: obrien@FreeBSD.ORG References: <20021009161756.E4040-100000@gamplex.bde.org> <20021009173106.9D1862A88D@canning.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021009173106.9D1862A88D@canning.wemm.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 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 Wed, Oct 09, 2002 at 10:31:06AM -0700, Peter Wemm wrote: > Bruce Evans wrote: > > On Tue, 8 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. > > > > Um, using intmax_t to print size_t's would be incorrect, since it is > > signed. Using uintmax_t would be bloat. Very few typedefed types > > need the full bloat of [u]intmax_t, and size_t is unlikely to become > > one of them before casting it to uintmax_t to print it becomes a style > > bug in the kernel too (when %z is implemented). > > Bring it on! The sooner %z gets here the better. The only problem is that > gcc has been taught that %z means something different in the kernel. :-( Yeah, I can fix that along with fixing %z. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message