From owner-freebsd-arch@FreeBSD.ORG Tue Mar 31 06:44:55 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 223A9106566B; Tue, 31 Mar 2009 06:44:55 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id D5D528FC19; Tue, 31 Mar 2009 06:44:54 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id AC8E973098; Tue, 31 Mar 2009 08:49:59 +0200 (CEST) Date: Tue, 31 Mar 2009 08:49:59 +0200 From: Luigi Rizzo To: Poul-Henning Kamp Message-ID: <20090331064959.GA3516@onelab2.iet.unipi.it> References: <49D1492C.5050101@freebsd.org> <95823.1238476941@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95823.1238476941@critter.freebsd.dk> User-Agent: Mutt/1.4.2.3i Cc: Daniel Eischen , FreeBSD Arch , Tim Kientzle , Marcel Moolenaar Subject: Re: On errno X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 06:44:55 -0000 On Tue, Mar 31, 2009 at 05:22:21AM +0000, Poul-Henning Kamp wrote: > In message <49D1492C.5050101@freebsd.org>, Tim Kientzle writes: > > >> The probelm with an integer is that you cannot give details > >> like: > >> "partition 3 overlaps bootcode" > >> without precreating the N^2 possible messages of that kind. > > > >The standard solution if you need variable parameters, > >of course, is to pass the parameters back: > > int code: EPARTITIONOVERLAPSBOOTCODE > > char *default_text: "partition %1d overlaps bootcode" > > arg1: 3 > > And the "standard" solution is stupid and useless, because more > often than not, some language, typically french, will want the > arguments in the opposite order... we are probably digressing but printf in glibc has specifiers to indicate which argument you want to use for each format. http://www.gnu.org/software/hello/manual/libc/Output-Conversion-Syntax.html I suppose this takes an extra pass over the format string to collect the proper type info for all arguments, so it is not not a dramatic change in the implementation of *printf. cheers luigi