From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25040 invoked by alias); 17 May 2005 15:15:51 -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 22391 invoked from network); 17 May 2005 15:13:49 -0000 Received: from unknown (HELO e6.ny.us.ibm.com) (32.97.182.146) by sourceware.org with SMTP; 17 May 2005 15:13:49 -0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e6.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j4HFDlfQ022130 for ; Tue, 17 May 2005 11:13:48 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j4HFDlOt138506 for ; Tue, 17 May 2005 11:13:47 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j4HFDl2P030157 for ; Tue, 17 May 2005 11:13:47 -0400 Received: from imap.linux.ibm.com (imap.rtp.raleigh.ibm.com [9.42.107.100]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j4HFDMG4026784 for ; Tue, 17 May 2005 11:13:44 -0400 Received: by imap.linux.ibm.com (Postfix, from userid 48) id 682107C00C; Tue, 17 May 2005 11:13:21 -0400 (EDT) Received: from sig-9-65-75-76.mts.ibm.com (sig-9-65-75-76.mts.ibm.com [9.65.75.76]) by imap.rtp.raleigh.ibm.com (IMP) with HTTP for ; Tue, 17 May 2005 11:13:21 -0400 Message-ID: <1116342801.428a0a113167f@imap.linux.ibm.com> Date: Tue, 17 May 2005 20:19:00 -0000 From: Wu Zhou To: gdb-patches@sources.redhat.com Subject: two questions about GDB coding standards MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.7 X-SW-Source: 2005-05/txt/msg00426.txt.bz2 Hello all, I am now reading GDB coding standards(section 13.4 of GDB Internals) and have two questions as follow. Maybe someone of you could clarify for me. Thanks in advance. 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. Besides this in-consistence, we also know that sprintf is very prone to buffer overflow error. So my question here is whether sprintf should be replaced by xasprintf here or is there any plan to achieve this? 2. In section 13.4.3(compiler warnings), it is said that: due to the way that gdb is implemented most functions have unused parameters. Consequently the warning "-Wunused-parameter" is precluded from the list. What is the way it refered in this context? BTW, I also find there are many unused variables in gdb source codes by using a static analysis tool. But there is no "-Wunused-variable" in compiler option to detect this. My question here is: should this kind of unused variables be detected or furthermore be removed out of the source to make it more readable? The coding standards doesn't say anything about this. Thanks for your attention. Cheers - Wu Zhou