From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4268 invoked by alias); 26 Feb 2010 20:11:01 -0000 Received: (qmail 4195 invoked by uid 22791); 26 Feb 2010 20:10:59 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Feb 2010 20:10:54 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1QKAqtb020469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 26 Feb 2010 15:10:53 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QKAq4j007288; Fri, 26 Feb 2010 15:10:52 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o1QKApTJ023808; Fri, 26 Feb 2010 15:10:51 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 400F5378261; Fri, 26 Feb 2010 13:10:51 -0700 (MST) From: Tom Tromey To: Jan Kratochvil Cc: Sami Wagiaalla , GDB Patches Subject: Re: [patch] Add support for imported declaration and correct search order References: <4B86DA17.5040200@redhat.com> <20100225224145.GA21231@host0.dyn.jankratochvil.net> Reply-To: tromey@redhat.com Date: Fri, 26 Feb 2010 20:11:00 -0000 In-Reply-To: <20100225224145.GA21231@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Thu, 25 Feb 2010 23:41:45 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00656.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: >> + retval->declaration = savestring (declaration, strlen (declaration)); Jan> (sure really only a nitpick) That is what 70% of my reviews consist of :-) Jan> These savestring calls can be simplified to: Jan> # + retval->declaration = xstrdup (declaration); Jan> as was cleaned up by: Jan> [obv] Replace savestring by xstrdup where possible Jan> http://sourceware.org/ml/gdb-patches/2009-05/msg00516.html Jan> but new `savestring (X, strlen (X))' calls apparently crept in Jan> since that time. Yes, thanks -- I forgot about this. In this case I think these have to be replaced with obstack allocations anyhow, since currently they are all leaked. According to the appended semantic patch, the uses of savestring in this function are the only "bad" ones. Tom @@ expression e; @@ - savestring (e, strlen (e)) + xstrdup (e)