From owner-freebsd-hackers Fri Jan 3 9: 0: 8 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4DAEE37B401 for ; Fri, 3 Jan 2003 09:00:07 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1DC543EE6 for ; Fri, 3 Jan 2003 09:00:05 -0800 (PST) (envelope-from brandt@fokus.gmd.de) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id h03H04J22716 for ; Fri, 3 Jan 2003 18:00:04 +0100 (MET) Date: Fri, 3 Jan 2003 18:00:04 +0100 (CET) From: Harti Brandt To: hackers@freebsd.org Subject: printing of uint64_t in the kernel Message-ID: <20030103175514.H901-100000@beagle.fokus.gmd.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, while porting the NgATM stuff to sparc64 I could not answer the following question: What is the correct way to printf() an uint64_t in the kernel. For i386 I need %llu, for sparc64 I need %lu or gcc will give a warning. I see two variants: 1. include or and use the standard printf format strings. 2. cast always to uintmax_t and use %ju. The first possibilities seems wrong, because one should not include a non-system header, the second because given a (hypothetical) machine with 128-bit uintmax_t this would incure a useless overhead. So what? harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.gmd.de, brandt@fokus.fhg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message