This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [SPAM] Re: [PATCH 0/8] Add -Wshadow=local
>>>>> "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);