From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13688 invoked by alias); 6 Aug 2012 13:34:24 -0000 Received: (qmail 13674 invoked by uid 22791); 6 Aug 2012 13:34:22 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com) (209.85.212.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Aug 2012 13:34:09 +0000 Received: by wibhq4 with SMTP id hq4so1254997wib.12 for ; Mon, 06 Aug 2012 06:34:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=UFuuStdiLiRSwZQY3UXahp+8OzrC0ovFCrRUWdxLVKk=; b=NWM5ODC6iSdll3SSzNwG5d7S/3XYXMvzDCb4p92zAEhlpwLoUvvJVHbCiYbFih6PcA dzDkt/Rm1A0EfhrgvUXyYSROAwzZcVYrOAA0Bh+HaNpMeMJ0GnbVfmZxwS4oXzxf15nG 4r1TSUyBg+RgjniLF0v0rAsW7VL56r98iLhvGI/kanQTyGCTJeY+FmYe/EBS+pYOH2fR eqbOETCrwGqQR9NAEqVJrp6nj6bRSa9IwJ55qRz0nxq4x1irfHWqnM4I8+6feQde11qa xFd209l4jIctJHtFBm0fTls6jiLMGuCQOvBmbxm6T8iXsMhpsYzzcSOd59QE747uOzH8 QE2w== MIME-Version: 1.0 Received: by 10.217.0.75 with SMTP id k53mr5415364wes.214.1344260047689; Mon, 06 Aug 2012 06:34:07 -0700 (PDT) Received: by 10.216.137.157 with HTTP; Mon, 6 Aug 2012 06:34:07 -0700 (PDT) In-Reply-To: References: Date: Mon, 06 Aug 2012 13:34:00 -0000 Message-ID: Subject: Re: Refactor tdep-i386.c to fix all -Wshadow warnings From: Goncalo Gomes To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkTuacIHKdyyCD6kEHwl7PxjtVA5uzhMrbJ6LAoqKbtBlzEdfY60l2YxhoOr+Ttgnz/FBNE 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/msg00165.txt.bz2 On Mon, Aug 6, 2012 at 11:46 AM, Sergio Durigan Junior wrote: > 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. > (...) > 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 for reviewing. I have (hopefully) applied all your suggestions. I'm going to re-send the revised patch and changelog in a follow-up email with a new subject line. Goncalo