This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ob] More warnings; Call for assistance


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 <drow@false.org>
> > 
> > > > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]