From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NQgBv-0005Eb-An for mharc-grub-devel@gnu.org; Fri, 01 Jan 2010 07:01:15 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQgBu-0005EJ-BD for grub-devel@gnu.org; Fri, 01 Jan 2010 07:01:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQgBq-0005BZ-Ta for grub-devel@gnu.org; Fri, 01 Jan 2010 07:01:14 -0500 Received: from [199.232.76.173] (port=43826 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQgBq-0005BW-O0 for grub-devel@gnu.org; Fri, 01 Jan 2010 07:01:10 -0500 Received: from smarthost02.mail.zen.net.uk ([212.23.3.141]:53328) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQgBq-00069H-AQ for grub-devel@gnu.org; Fri, 01 Jan 2010 07:01:10 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1NQgBn-0005Pr-Ba for grub-devel@gnu.org; Fri, 01 Jan 2010 12:01:07 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1NQgBm-0001Mg-00; Fri, 01 Jan 2010 12:01:06 +0000 Date: Fri, 1 Jan 2010 12:01:06 +0000 From: Colin Watson To: The development of GNU GRUB Message-ID: <20100101120106.GV5847@riva.ucam.org> References: <4B39CC24.9060607@gmail.com> <20100101093222.GU5847@riva.ucam.org> <20100101115256.GG3692@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100101115256.GG3692@thorin> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost02-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] switch from sprintf to asprintf and snprintf X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2010 12:01:14 -0000 On Fri, Jan 01, 2010 at 12:52:56PM +0100, Robert Millan wrote: > On Fri, Jan 01, 2010 at 09:32:24AM +0000, Colin Watson wrote: > > On Tue, Dec 29, 2009 at 10:30:12AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > > > +char *EXPORT_FUNC(grub_asprintf) (const char *fmt, ...) > > > + __attribute__ ((format (printf, 1, 2))); > > > > It's very confusing that you've made grub_asprintf have a dramatically > > different interface from asprintf. Perhaps you could call this > > grub_xasprintf instead? > > Is it feasible to implement the same interface as asprintf instead? asprintf is not really the ideal interface; most people forget to handle errors when using it, and it's verbose even when used well. If there's a single approach to out-of-memory errors that's appropriate throughout, then something like xasprintf is much better. -- Colin Watson [cjwatson@ubuntu.com]