Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: PATCH: Add type_sprint() function to return type in string form
Date: Tue, 22 Apr 2003 19:21:00 -0000	[thread overview]
Message-ID: <3EA5961E.3060102@redhat.com> (raw)
In-Reply-To: <20030422173348.GA325@nevyn.them.org>


>> GDB should use neither sprint* nor asprint*.
> 
> 
> I disagree.  Why on earth wouldn't we use sprintf?  Just because it can
> be used incorrectly is no excuse.

You're kidding right?

The ARI indicates that all sprintf calls should be replaced with either 
snprintf or xasprintf.

Replacing sprintf with functions that are immune to buffer overrun 
problems, eliminates an entire class of bug.

Even something as simple as:
	char buf[100000000];
	sprintf (buf, _("a"));
is broken.

>> The xasprint* family all have the signature:
>> 
>> 	...xasprint* (char **buf, ....)
>> 
>> which doesn't apply here.
> 
> 
> Perhaps it should apply?

Sure, but the interface would sux.

Andrew



  reply	other threads:[~2003-04-22 19:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-18 22:24 Jason Molenda
2003-04-22  3:26 ` Daniel Jacobowitz
2003-04-22 16:48   ` Andrew Cagney
2003-04-22 16:55     ` Daniel Jacobowitz
2003-04-22 17:29       ` Andrew Cagney
2003-04-22 17:33         ` Daniel Jacobowitz
2003-04-22 19:21           ` Andrew Cagney [this message]
2003-04-22 19:28             ` Daniel Jacobowitz
2003-04-22 20:16               ` Andrew Cagney
2003-04-22 20:22                 ` Daniel Jacobowitz
2003-04-22 20:35                   ` Jason Molenda
2003-04-22 21:15               ` Andrew Cagney
2003-04-22 19:55             ` Kevin Buettner
2003-04-23 14:23 ` Jason Molenda
2003-04-23 17:37   ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EA5961E.3060102@redhat.com \
    --to=ac131313@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox