From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7270 invoked by alias); 24 Apr 2012 18:04:28 -0000 Received: (qmail 7240 invoked by uid 22791); 24 Apr 2012 18:04:26 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Tue, 24 Apr 2012 18:04:05 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3OI44xk015848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 24 Apr 2012 14:04:04 -0400 Received: from psique (ovpn-112-42.phx2.redhat.com [10.3.112.42]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3OI3xAD016834; Tue, 24 Apr 2012 14:04:02 -0400 From: Sergio Durigan Junior To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFC/PATCH] Clean up unused variables (and prepare for `-Wunused-variable' flag) References: <4F968B4D.3050209@redhat.com> X-URL: http://www.redhat.com Date: Tue, 24 Apr 2012 18:10:00 -0000 In-Reply-To: <4F968B4D.3050209@redhat.com> (Pedro Alves's message of "Tue, 24 Apr 2012 12:15:25 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2012-04/txt/msg00818.txt.bz2 On Tuesday, April 24 2012, Pedro Alves wrote: > Hi S=C3=A9rgio, > > First off, thanks for doing this. Thanks for reviewing. > On 04/23/2012 11:51 PM, Sergio Durigan Junior wrote: > >> Hi, >>=20 >> This patch is a followup of the discussion in: >>=20 >> http://sourceware.org/ml/gdb/2012-04/msg00171.html>=20 >> First of all, I am sorry for the size of this patch, but I couldn't >> think of a good way of splitting it, and also I thought it would be >> useless since these changes are all logically related. > > > It's not useless at all. This warning points at two classes of problems: > > - variables that are no longer necessary, and can be garbage collected. > - variables that actually should be being used, but they're not due to > some latent bug. > > I skimmed the patch, and noted several places, mostly in tdep code, where > you end up removing more than the unsuspecting auxiliary and obviously-le= ft- > -behind-by-accident variable. Some of those removed bits could well be l= atent > bugs. Some hunks seem to remove used variables and expand what they were > initialized from at the used sites. What's up with that? Please give ra= tionale > for any change that requires more than idle brain power to understand. > :-) We already talked on IRC, but I'm replying this message for the sake of keep the record. As I said, initially I thought that those initialized-but-not-used cases were copy-and-paste mistakes. But thanks for pointing that. Here's what I'm going to do: - Split these cases by arch, and resubmit it so that the maintainers of each arch will get a chance to review and see if the case is a latent bug or not - Split and commit the obvious bits, as approved by Tromey and you in the other message in this thread. >> I'd like to apply it, but I have a couple of questions before: >>=20 >> a) How's the ChangeLog for this patch supposed to be? Can I make a >> "generic" ChangeLog, saying something like `Remove unused variables from >> files'? >>=20 >> b) I'd like someone to take a look at the `observer.sh' change, please. > > > Please sent it as a separate patch, along with a rationale. > Also, the .c files under features/ are generated files. We'll need to fix > the generator instead, again, best done as a separate patch. Thanks, I totally forgot about this fact! And I can't believe I didn't read the header comment on the top of those files :-). Anyway, this change will go as a separate patch as well. --=20 Sergio