From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id DD6E93858D28 for ; Fri, 3 Dec 2021 21:30:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD6E93858D28 X-ASG-Debug-ID: 1638567040-0c856e2e4745bc30001-z78K6e Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id aIRIeBtHQeFYhEWE (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 03 Dec 2021 16:30:40 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id BF5CF441B21; Fri, 3 Dec 2021 16:30:40 -0500 (EST) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb@sourceware.org Subject: [PATCH 1/2] gdb/csky-tdep.c: fix -Wunused-but-set-variable error Date: Fri, 3 Dec 2021 16:30:39 -0500 X-ASG-Orig-Subj: [PATCH 1/2] gdb/csky-tdep.c: fix -Wunused-but-set-variable error Message-Id: <20211203213040.1425503-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1638567040 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2446 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.94384 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-15.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2021 21:30:54 -0000 Fix these, seen when building with clang 14: CXX csky-tdep.o /home/simark/src/binutils-gdb/gdb/csky-tdep.c:332:7: error: variable 'need_dummy_stack' set but not used [-Werror,-Wunused-but-set-variable] int need_dummy_stack = 0; ^ /home/simark/src/binutils-gdb/gdb/csky-tdep.c:805:12: error: variable 'offset' set but not used [-Werror,-Wunused-but-set-variable] int offset = 0; ^ Change-Id: I6703bcb50e83c50083f716f4084ef6aa30d659c4 --- gdb/csky-tdep.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 0b073fb6f629..3f591445aca4 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -329,7 +329,6 @@ csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argnum; int argreg = CSKY_ABI_A0_REGNUM; int last_arg_regnum = CSKY_ABI_LAST_ARG_REGNUM; - int need_dummy_stack = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); std::vector stack_items; @@ -399,7 +398,6 @@ csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { /* The argument should be pushed onto the dummy stack. */ stack_items.emplace_back (4, val); - need_dummy_stack += 4; } len -= partial_len; val += partial_len; @@ -802,21 +800,18 @@ csky_analyze_prologue (struct gdbarch *gdbarch, else if (CSKY_32_IS_PUSH (insn)) { /* Push for 32_bit. */ - int offset = 0; if (CSKY_32_IS_PUSH_R29 (insn)) { stacksize += 4; register_offsets[29] = stacksize; if (csky_debug) print_savedreg_msg (29, register_offsets, false); - offset += 4; } if (CSKY_32_PUSH_LIST2 (insn)) { int num = CSKY_32_PUSH_LIST2 (insn); int tmp = 0; stacksize += num * 4; - offset += num * 4; if (csky_debug) { fprintf_unfiltered (gdb_stdlog, @@ -842,14 +837,12 @@ csky_analyze_prologue (struct gdbarch *gdbarch, register_offsets[15] = stacksize; if (csky_debug) print_savedreg_msg (15, register_offsets, false); - offset += 4; } if (CSKY_32_PUSH_LIST1 (insn)) { int num = CSKY_32_PUSH_LIST1 (insn); int tmp = 0; stacksize += num * 4; - offset += num * 4; if (csky_debug) { fprintf_unfiltered (gdb_stdlog, -- 2.33.1