From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16245 invoked by alias); 22 Apr 2003 19:21:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16238 invoked from network); 22 Apr 2003 19:21:05 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 22 Apr 2003 19:21:05 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id AE47C2B2F; Tue, 22 Apr 2003 15:21:02 -0400 (EDT) Message-ID: <3EA5961E.3060102@redhat.com> Date: Tue, 22 Apr 2003 19:21:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: PATCH: Add type_sprint() function to return type in string form References: <20030418152426.A93348@molenda.com> <20030422032629.GB5033@nevyn.them.org> <3EA57249.5020104@redhat.com> <20030422165455.GA31686@nevyn.them.org> <3EA57BD9.5020502@redhat.com> <20030422173348.GA325@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00407.txt.bz2 >> 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