From 821a26825bdcb96358a51f5c2140475951429470 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Mon, 6 Aug 2018 13:54:34 +0200 Subject: [PATCH] Remove unused variables in procfs.c etc. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The recent patch to enable -Wunused-variable uncovered a couple of instances in Solaris-specific files: /vol/src/gnu/gdb/hg/master/dist/gdb/proc-api.c: In function ‘void _initialize_proc_api()’: /vol/src/gnu/gdb/hg/master/dist/gdb/proc-api.c:422:28: error: unused variable ‘c’ [-Werror=unused-variable] struct cmd_list_element *c; ^ /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In function ‘void procfs_init_inferior(target_ops*, int)’: /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:2895:12: error: unused variable ‘signals’ [-Werror=unused-variable] sigset_t signals; ^~~~~~~ /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In member function ‘virtual char* procfs_target::make_corefile_notes(bfd*, int*)’: /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:3845:19: error: unused variable ‘old_chain’ [-Werror=unused-variable] struct cleanup *old_chain; ^~~~~~~~~ /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:3847:18: error: unused variable ‘fpregs’ [-Werror=unused-variable] gdb_fpregset_t fpregs; ^~~~~~ Fixed as follows. Tested on amd64-pc-solaris2.11, installed as obvious. * proc-api.c (_initialize_proc_api): Remove c, unused. * procfs.c (procfs_init_inferior): Remove signals, unused. (procfs_target::make_corefile_notes): Remove old_chain, fpregs, unused. --- gdb/ChangeLog | 7 +++++++ gdb/proc-api.c | 2 -- gdb/procfs.c | 3 --- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0d38674640e..55930d015a2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-08-06 Rainer Orth + + * proc-api.c (_initialize_proc_api): Remove c, unused. + * procfs.c (procfs_init_inferior): Remove signals, unused. + (procfs_target::make_corefile_notes): Remove old_chain, fpregs, + unused. + 2018-08-06 Sergey Korolev Andrew Burgess diff --git a/gdb/proc-api.c b/gdb/proc-api.c index 75e805523bf..ab160b1d021 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -419,8 +419,6 @@ proc_prettyfprint_status (long flags, int why, int what, int thread) void _initialize_proc_api (void) { - struct cmd_list_element *c; - add_setshow_boolean_cmd ("procfs-trace", no_class, &procfs_trace, _("\ Set tracing for /proc api calls."), _("\ Show tracing for /proc api calls."), NULL, diff --git a/gdb/procfs.c b/gdb/procfs.c index e6c6066c496..ec346503487 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2892,7 +2892,6 @@ static void procfs_init_inferior (struct target_ops *ops, int pid) { procinfo *pi; - sigset_t signals; int fail; int lwpid; @@ -3842,9 +3841,7 @@ find_stop_signal (void) char * procfs_target::make_corefile_notes (bfd *obfd, int *note_size) { - struct cleanup *old_chain; gdb_gregset_t gregs; - gdb_fpregset_t fpregs; char fname[16] = {'\0'}; char psargs[80] = {'\0'}; procinfo *pi = find_procinfo_or_die (inferior_ptid.pid (), 0); -- 2.30.2