From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8174 invoked by alias); 21 Jan 2006 15:18:43 -0000 Received: (qmail 8166 invoked by uid 22791); 21 Jan 2006 15:18:42 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 21 Jan 2006 15:18:41 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F0KVj-0000Dn-J3 for gdb-patches@sourceware.org; Sat, 21 Jan 2006 10:18:39 -0500 Date: Sat, 21 Jan 2006 15:18:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [ob] More warnings; Call for assistance Message-ID: <20060121151839.GB600@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <20060117151730.GA2420@nevyn.them.org> <20060117152156.GA3115@nevyn.them.org> <8f2776cb0601171137yffbcd4exefdefe7c8a79bbf3@mail.gmail.com> <20060117194624.GA10188@nevyn.them.org> <20060120230641.GA21181@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00278.txt.bz2 On Sat, Jan 21, 2006 at 12:07:24PM +0200, Eli Zaretskii wrote: > > Date: Fri, 20 Jan 2006 18:06:41 -0500 > > From: Daniel Jacobowitz > > > > > > avoid the use of standard printf > > > > > > Avoid? how? are you saying that we should write our own version of > > > printf? > > > > Certainly we shouldn't write a new one - but the advantage of being a > > GNU project and licensed under the GPL is that there's already at least > > two we can choose from, probably more :-) > > Doing so would probably get us also the possible bugs of those > implementations, but that's a minor issue. > > A more important issue is how do we convince ourselves that the > implementation we use does not blow up in some cases as well, just in > different ones? `printf' implementations are traditionally reckless > about bad format strings. Are the ones you suggest any better? As far as I know, yes - for instance, newlib's seems to be careless only in that it does sensible things for meaningless format flags. The big difference between calling printf and having our own implementation is that we could decode the GDB arguments - whose types we know - at exactly the time they are consumed by printf. Anyway, I'm not sure it's worth it or not. -- Daniel Jacobowitz CodeSourcery