From owner-freebsd-current Tue Jan 20 13:18:16 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA06291 for current-outgoing; Tue, 20 Jan 1998 13:18:16 -0800 (PST) (envelope-from owner-freebsd-current) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA06282 for ; Tue, 20 Jan 1998 13:18:10 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.8.8/8.8.5) id QAA14891; Tue, 20 Jan 1998 16:18:03 -0500 (EST) Date: Tue, 20 Jan 1998 16:18:03 -0500 (EST) From: Garrett Wollman Message-Id: <199801202118.QAA14891@khavrinen.lcs.mit.edu> To: Terry Lambert Cc: ache@nagual.pp.ru (=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=), current@FreeBSD.ORG Subject: Re: Nasty GCC bug? In-Reply-To: <199801202053.NAA25835@usr06.primenet.com> References: <199801202053.NAA25835@usr06.primenet.com> Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk < said: > Also, my field width limits are being ignored. I kind of expected > it to print out a field limit's worth of hex characters, starting at > the lsb. No. >From printf(3): o An optional decimal digit string specifying a minimum field width. If the converted value has fewer characters than the field width, it will be padded with spaces on the left (or right, if the left-adjust- ment flag has been given) to fill out the field width. What you wanted is not available in the standard printf(3) model, since the precision means something else: o An optional precision, in the form of a period `.' followed by an op- tional digit string. If the digit string is omitted, the precision is taken as zero. This gives the minimum number of digits to appear for d, i, o, u, x, and X conversions, the number of digits to appear after the decimal-point for e, E, and f conversions, the maximum num- ber of significant digits for g and G conversions, or the maximum number of characters to be printed from a string for s conversions. One might wish that the precision for %d meant the same thing as for %s, which is what you want, but it doesn't. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick