From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2482 invoked by alias); 18 May 2005 09:52:11 -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 2265 invoked from network); 18 May 2005 09:51:53 -0000 Received: from unknown (HELO e33.co.us.ibm.com) (32.97.110.131) by sourceware.org with SMTP; 18 May 2005 09:51:53 -0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j4I9pnmD392498 for ; Wed, 18 May 2005 05:51:49 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j4I9pmnP203280 for ; Wed, 18 May 2005 03:51:48 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j4I9pmWX025772 for ; Wed, 18 May 2005 03:51:48 -0600 Received: from imap.linux.ibm.com (imap.rtp.raleigh.ibm.com [9.42.107.100]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j4I9pLYk025454; Wed, 18 May 2005 03:51:48 -0600 Received: by imap.linux.ibm.com (Postfix, from userid 48) id 4033D7C015; Wed, 18 May 2005 05:51:21 -0400 (EDT) Received: from ibmcsdl-9m89c83.cn.ibm.com (ibmcsdl-9m89c83.cn.ibm.com [9.181.134.123]) by imap.rtp.raleigh.ibm.com (IMP) with HTTP for ; Wed, 18 May 2005 05:51:20 -0400 Message-ID: <1116409880.428b10186817f@imap.linux.ibm.com> Date: Wed, 18 May 2005 10:25:00 -0000 From: Wu Zhou To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: two questions about GDB coding standards MIME-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.7 X-SW-Source: 2005-05/txt/msg00448.txt.bz2 Quoting Eli Zaretskii : > > Date: Tue, 17 May 2005 11:13:21 -0400 > > From: Wu Zhou > > > > 1. In section 13.4.2(memory management), it is said that gdb uses the > > string function xstrdup and the print function xasprintf. But I saw > > in the source codes that most places use sprintf instead. > > This is just a matter of converting the uses of sprintf into safer > code using xstrdup, xasprintf, xsprintf, etc. Volunteers are welcome. I'd like to contribute. But running splint against GDB source tree, I find over 230 usages of sprintf. If the conversion depends completely on hand work, the workload might be quite big. Is there any method to achieve this more quickly? to say, a script to handle it automatically, or any others? Cheers - Wu Zhou