From owner-cvs-all Sun Jan 19 15:47:31 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0912E37B401; Sun, 19 Jan 2003 15:47:30 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0969D43F3F; Sun, 19 Jan 2003 15:47:28 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id KAA16927; Mon, 20 Jan 2003 10:47:04 +1100 Date: Mon, 20 Jan 2003 10:48:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "M. Warner Losh" Cc: jmallett@FreeBSD.org, , Subject: Re: cvs commit: src/sbin/dumpfs dumpfs.c In-Reply-To: <20030119.133145.02779620.imp@bsdimp.com> Message-ID: <20030120103433.Y21079-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 19 Jan 2003, M. Warner Losh wrote: > In message: <200301191213.h0JCDlRT025151@repoman.freebsd.org> > Juli Mallett writes: > : XXX Lots of this assumes int32 can be printed with %d. Yuck. > > Why is that a problem? If int is 32bits, it is right. If int is 64 > bits, it will be promoted to 64 bit in before being passed. Either > way it is right. > > It fails in the int is 16 bit case, but who cares about that? Only C programmers. It also fails in the int is 17-31 bit cases, and on systems where longs are 32 bits and int32_t happens to be implemented as long. Note that in 4.4BSDLite1, most of the int32_t fields in . They were changed to int32_t in 4.4BSDLite2, but the formats used to print them haven't changed. gcc -Wformat would have detected the format mismatches in Lite1 but now happens not to notice because of the implementation details of int32_t. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message