From patchwork Fri Oct 5 13:37:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 29657 Received: (qmail 100154 invoked by alias); 5 Oct 2018 13:37:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 99472 invoked by uid 89); 5 Oct 2018 13:37:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_MARK, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2539 X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.35) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Oct 2018 13:37:41 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id D5D085696 for ; Fri, 5 Oct 2018 08:37:39 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 8QIVgaNJ379N38QIVghcop; Fri, 05 Oct 2018 08:37:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+/pUaTZK2PxSmT6KTd8pvpzodpFaMOKOUMjYL5snIms=; b=rTXvlv7al26Y8FCvkRvx89yhIA p9oryti0+/V3mwBWC1TGMiC8snhT0i+kv4khREcQA0tgEao9hgmu0tn2B4omSV4PdJEpEZUYTf/M5 YFMICP3nJnyk7lT9z+RVnuqo7; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:42264 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g8QIV-000NNX-D2; Fri, 05 Oct 2018 08:37:39 -0500 From: Tom Tromey To: Rainer Orth Cc: Tom Tromey , Joel Brobecker , Pedro Alves , Simon Marchi , "gdb-patches\@sourceware.org" Subject: Re: [SPAM] Re: [PATCH 0/8] Add -Wshadow=local 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> Date: Fri, 05 Oct 2018 07:37:38 -0600 In-Reply-To: (Rainer Orth's message of "Fri, 05 Oct 2018 11:06:27 +0200") Message-ID: <878t3cfra5.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 >>>>> "Rainer" == Rainer Orth writes: Rainer> this patch series broke the Solaris builds: Rainer> ../../binutils-gdb/gdb/sol-thread.c: In member function ‘virtual ptid_t sol_thread_target::wait(ptid_t, target_waitstatus*, int)’: Rainer> ../../binutils-gdb/gdb/sol-thread.c:443:14: error: declaration of ‘save_ptid’ shadows a previous local [-Werror=shadow=compatible-local] Rainer> ptid_t save_ptid = ptid; Rainer> ^~~~~~~~~ Rainer> ../../binutils-gdb/gdb/sol-thread.c:432:10: note: shadowed declaration is here Rainer> ptid_t save_ptid; Rainer> ^~~~~~~~~ Thanks for the report. If you can try the appended, that would be nice. If not, I will check it in, since it looks reasonably obviously correct. Normally I would ask the buildbot to try it but I get: bapiya. buildbot try -b Solaris11-amd64-m64 === ERROR: You probably have an invalid builder in the list of Try Builders === === Please, double-check the list of available builders at === === === ... which seems incorrect to me. Tom commit 10554739e0b88e3332e7e63f1bf36d1e7a25442f Author: Tom Tromey Date: Fri Oct 5 07:28:16 2018 -0600 Fix -Wshadow=local warning in sol_thread_target::wait Rainer pointed out that -Wshadow=local broke the Solaris build. This fixes it. gdb/ChangeLog 2018-10-05 Tom Tromey * sol-thread.c (sol_thread_target::wait): Rename inner "save_ptid". diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 912bdecfb2..a533ffdba2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-10-05 Tom Tromey + + * sol-thread.c (sol_thread_target::wait): Rename inner + "save_ptid". + 2018-10-04 Tom Tromey * configure: Rebuild. diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 5cdc9a8c1e..682302a40b 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -440,14 +440,14 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, if (ptid.pid () != -1) { - ptid_t save_ptid = ptid; + ptid_t ptid_for_warning = ptid; ptid = thread_to_lwp (ptid, -2); if (ptid.pid () == -2) /* Inactive thread. */ error (_("This version of Solaris can't start inactive threads.")); if (info_verbose && ptid.pid () == -1) warning (_("Specified thread %ld seems to have terminated"), - save_ptid.tid ()); + ptid_for_warning.tid ()); } rtnval = beneath ()->wait (ptid, ourstatus, options);