From d0975d800285f61d60cd7c3f47b185304a09a052 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Thu, 15 Sep 2022 04:06:09 +0000 Subject: bfd, binutils, gas: Remove/mark unused variables Clang generates a warning on unused (technically, written but not read thereafter) variables. By the default configuration (with "-Werror"), it causes a build failure (unless "--disable-werror" is specified). This commit adds ATTRIBUTE_UNUSED attribute to some of them, which means they are *possibly* unused (can be used but no warnings occur when unused) and removes others. bfd/ChangeLog: * elf32-lm32.c (lm32_elf_size_dynamic_sections): Mark unused rgot_count variable. * elf32-nds32.c (elf32_nds32_unify_relax_group): Remove unused count variable. * mmo.c (mmo_scan): Mark unused lineno variable. binutils/ChangeLog: * windmc.c (write_rc): Remove unused i variable. gas/ChangeLog: * config/tc-riscv.c (riscv_ip): Remove unused argnum variable. ld/ChangeLog: * pe-dll.c (generate_reloc): Remove unused bi and page_count variables. --- gas/config/tc-riscv.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'gas') diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index df2e201..2f5ee18 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -2303,7 +2303,6 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, char save_c = 0; struct riscv_opcode *insn; unsigned int regno; - int argnum; const struct percent_op_match *p; struct riscv_ip_error error; error.msg = "unrecognized opcode"; @@ -2341,7 +2340,6 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, error.msg = _("illegal operands"); error.missing_ext = NULL; create_insn (ip, insn); - argnum = 1; imm_expr->X_op = O_absent; *imm_reloc = BFD_RELOC_UNUSED; @@ -2859,7 +2857,6 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, break; /* end RVV */ case ',': - ++argnum; if (*asarg++ == *oparg) continue; asarg--; -- cgit v1.1