From owner-freebsd-arch Wed Oct 9 11:39:25 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 BE58237B407 for ; Wed, 9 Oct 2002 11:39:23 -0700 (PDT) Received: from mail.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7664443E88 for ; Wed, 9 Oct 2002 11:39:20 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 28130 invoked from network); 9 Oct 2002 18:39:21 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail17.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 9 Oct 2002 18:39:21 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id g99IdIn5011662; Wed, 9 Oct 2002 14:39:18 -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: Date: Wed, 09 Oct 2002 14:39:22 -0400 (EDT) From: John Baldwin To: John Baldwin Subject: Re: lp64 vs lp32 printf Cc: freebsd-arch@FreeBSD.org, Peter Wemm , 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 John Baldwin wrote: > > On 09-Oct-2002 Andrew Gallatin wrote: >> >> John Baldwin writes: >> > >> > On 09-Oct-2002 Andrew Gallatin wrote: >> > > >> > > Peter Wemm writes: >> > > > > >> > > > > 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. :-( >> > > >> > > Where is gcc taught these things? Can we update it? >> > >> > We should be able to change the kernel %z to some other weird letter. >> >> Sure.. but do you know where in the sources %z is defined to be >> something weird? > > sys/kern/subr_prf.c in the kernel, and in the -fformat-extensions local > patches stuff for gcc. I think the gcc work wouldn't be too difficult > to do since it would just be renaming a letter. Hmm, I was incorrect > (my grep re was busted) and %z is actually used in two places in ddb. > We can either pick a letter to use or just use %x with explicit signs > in those two cases: > > ddb/db_examine.c: db_printf("%-*lz", width, (long)value); > ddb/db_examine.c: db_printf("%8lz", (long)addr); > > Hmm, the second case doesn't even use a sign so it can be %x anyways. And the first one doesn't use the '+' modifier either so it can just be converted to use '%x' as well. Hmm, more likely is that probably these two places should be using '+z' instead of just 'z'. So, maybe 'y' instead of 'z'? -- 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