From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26238 invoked by alias); 6 Aug 2012 10:46:27 -0000 Received: (qmail 26221 invoked by uid 22791); 6 Aug 2012 10:46:25 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,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; Mon, 06 Aug 2012 10:46:12 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q76AkBL3003615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Aug 2012 06:46:11 -0400 Received: from psique (ovpn-113-81.phx2.redhat.com [10.3.113.81]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q76Ak8rv009885; Mon, 6 Aug 2012 06:46:09 -0400 From: Sergio Durigan Junior To: Goncalo Gomes Cc: gdb-patches@sourceware.org Subject: Re: Refactor tdep-i386.c to fix all -Wshadow warnings References: X-URL: http://www.redhat.com Date: Mon, 06 Aug 2012 10:46:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-08/txt/msg00161.txt.bz2 On Sunday, August 05 2012, Goncalo Gomes wrote: > The attached patch fixes all warnings in tdep-i386.c resulting from > enabling shadow warnings in gcc. As this is my first contribution to > GDB, I decided to keep it short to a single file to obtain feedback. Thanks for your patch. It is a cleanup and not a big patch, thus I guess you won't need a copyright assignment to get it in. However, if you would like to start the process, drop me an e-mail offlist and I can send you the form. I have a few comments regarding formatting nits. > 2012-08-05 Goncalo Gomes Two spaces between your name and your e-mail address. > > * Refactor tdep-i386.c to fix all -Wshadow warnings You have to explicit mention each file, and each function/location being modified. Take a look at gdb/ChangeLog to see how it is done. You also need to indent the entries using a tab, and not spaces. Something like: 2012-08-06 Goncalo Gomes * exceptions.h (TRY_CATCH): Rename `buf' to `trycatch_sjbuf'. * i386-tdep.c (....)... > diff --git a/gdb/exceptions.h b/gdb/exceptions.h > index 0c59a25..9c47a7b 100644 > --- a/gdb/exceptions.h > +++ b/gdb/exceptions.h > @@ -145,9 +145,9 @@ int exceptions_state_mc_action_iter_1 (void); > > #define TRY_CATCH(EXCEPTION,MASK) \ > { \ > - EXCEPTIONS_SIGJMP_BUF *buf = \ > + EXCEPTIONS_SIGJMP_BUF *_trycatch_sjbuf = \ > exceptions_state_mc_init (&(EXCEPTION), (MASK)); \ > - EXCEPTIONS_SIGSETJMP (*buf); \ > + EXCEPTIONS_SIGSETJMP (*_trycatch_sjbuf); \ > } \ > while (exceptions_state_mc_action_iter ()) \ > while (exceptions_state_mc_action_iter_1 ()) Is it possible to remove the leading `_' from `_trycatch_sjbuf'? It should be used only for internal variables inside some library which I forgot the name... > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index 84e9794..6fbc51f 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -3561,7 +3561,7 @@ i386_stap_parse_special_token (struct gdbarch *gdbarch, > const char *start; > char *base; > int len_base; > - char *index; > + char *idx; > int len_index; Please change this variable to `len_idx', since it refers to `idx' now. Aside of that, I guess the patch is pretty trivial. I am not a maintainer, so you will still need an approval from a maintainer before being able to check it in. In fact, I guess you won't be able to check it in for yourself because you still don't have an account on sourceware, so probably someone else will commit it for you. Thanks, -- Sergio