Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Cc: Tom Tromey <tom@tromey.com>,
	 Joel Brobecker <brobecker@adacore.com>,
	 Pedro Alves <palves@redhat.com>,
	 Simon Marchi <simon.marchi@ericsson.com>,
	 "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [SPAM] Re: [PATCH 0/8] Add -Wshadow=local
Date: Fri, 05 Oct 2018 13:37:00 -0000	[thread overview]
Message-ID: <878t3cfra5.fsf@tromey.com> (raw)
In-Reply-To: <yddsh1kyd7w.fsf@CeBiTec.Uni-Bielefeld.DE> (Rainer Orth's message	of "Fri, 05 Oct 2018 11:06:27 +0200")

>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 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 ===
    === <https://sourceware.org/gdb/wiki/BuildBot#Configuration_file_for_.22buildbot_try.22> ===

... which seems incorrect to me.

Tom

commit 10554739e0b88e3332e7e63f1bf36d1e7a25442f
Author: Tom Tromey <tom@tromey.com>
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  <tom@tromey.com>
    
            * 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  <tom@tromey.com>
+
+	* sol-thread.c (sol_thread_target::wait): Rename inner
+	"save_ptid".
+
 2018-10-04  Tom Tromey  <tom@tromey.com>
 
 	* 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);


  parent reply	other threads:[~2018-10-05 13:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-23  4:08 Tom Tromey
2018-09-23  4:08 ` [PATCH 5/8] Fix latent bug in msp430-tdep.c Tom Tromey
2018-10-12  4:10   ` Kevin Buettner
2018-09-23  4:08 ` [PATCH 8/8] Add -Wshadow=local Tom Tromey
2018-09-23  4:08 ` [PATCH 3/8] Use std::string in mdebugread.c Tom Tromey
2018-10-12  4:27   ` Kevin Buettner
2018-09-23  4:08 ` [PATCH 2/8] Avoid shadowing in gdbserver Tom Tromey
2018-10-12  4:19   ` Kevin Buettner
2018-09-23  4:08 ` [PATCH 6/8] Avoid shadowing in fdwalk Tom Tromey
2018-10-12  4:54   ` Kevin Buettner
2018-09-23  4:08 ` [PATCH 4/8] Avoid shadowing in linux-tdep.c Tom Tromey
2018-10-12  4:50   ` Kevin Buettner
2018-09-23  4:08 ` [PATCH 7/8] Shadowing fix in gdbscm_frame_read_var Tom Tromey
     [not found]   ` <6d098a36-c483-77b8-61a6-87768c29f5d5@ericsson.com>
2018-10-04 12:44     ` Tom Tromey
2018-09-23  4:09 ` [PATCH 1/8] Simple -Wshadow=local fixes Tom Tromey
2018-10-04  3:36   ` Simon Marchi
2018-10-04 12:22     ` Simon Marchi
2018-10-04 12:43       ` Tom Tromey
2018-10-03 15:02 ` [PATCH 0/8] Add -Wshadow=local Simon Marchi
     [not found]   ` <c0393dbe-9dbe-837a-b93d-7c2825ef3649@ericsson.com>
     [not found]     ` <04748d1d-0fe6-76ad-31f1-68657f8e0d56@redhat.com>
2018-10-03 17:53       ` Joel Brobecker
2018-10-05  4:57         ` Tom Tromey
2018-10-05  9:06           ` Rainer Orth
2018-10-05 11:14             ` Joel Brobecker
2018-10-05 13:37             ` Tom Tromey [this message]
2018-10-05 15:58               ` [SPAM] " Rainer Orth
2018-10-12  5:25 ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t3cfra5.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    --cc=simon.marchi@ericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox