From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117853 invoked by alias); 5 Oct 2018 11:14:58 -0000 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 Received: (qmail 117839 invoked by uid 89); 5 Oct 2018 11:14:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Oct 2018 11:14:56 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3FCC256133; Fri, 5 Oct 2018 07:14:55 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qcy1dq8WJQQ0; Fri, 5 Oct 2018 07:14:55 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F174656003; Fri, 5 Oct 2018 07:14:54 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 20B9582C67; Fri, 5 Oct 2018 04:14:53 -0700 (PDT) Date: Fri, 05 Oct 2018 11:14:00 -0000 From: Joel Brobecker To: Rainer Orth Cc: Tom Tromey , Pedro Alves , Simon Marchi , "gdb-patches@sourceware.org" Subject: Re: [PATCH 0/8] Add -Wshadow=local Message-ID: <20181005111453.GD2477@adacore.com> References: <20180923040814.27941-1-tom@tromey.com> <29c17639-6ee6-b089-be95-227f98ac0ccf@ericsson.com> <04748d1d-0fe6-76ad-31f1-68657f8e0d56@redhat.com> <20181003175309.GB2477@adacore.com> <87k1mxf0s1.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-10/txt/msg00127.txt.bz2 > this patch series broke the Solaris builds: > > ../../binutils-gdb/gdb/sol-thread.c: In member function ‘virtual ptid_t sol_thread_target::wait(ptid_t, target_waitstatus*, int)’: > ../../binutils-gdb/gdb/sol-thread.c:443:14: error: declaration of ‘save_ptid’ shadows a previous local [-Werror=shadow=compatible-local] > ptid_t save_ptid = ptid; > ^~~~~~~~~ > ../../binutils-gdb/gdb/sol-thread.c:432:10: note: shadowed declaration is here > ptid_t save_ptid; > ^~~~~~~~~ Looking at the code, that's one location where I think the warning is pretty nice; while it might not flag in the code, I think the code itself could be clearer if we used two different variable names. What's your take on this? Do you think it would make sense? And would you be able to make that change; as far as I can tell, if I were to attempt the change myself, I would probably change the name of the first one to something like save_inferior_ptid, or something like that. Thanks! -- Joel