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. --- binutils/windmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'binutils/windmc.c') diff --git a/binutils/windmc.c b/binutils/windmc.c index b47da91..9a22e49 100644 --- a/binutils/windmc.c +++ b/binutils/windmc.c @@ -765,7 +765,7 @@ static void write_rc (FILE *fp) { mc_node_lang *n; - int i, l; + int l; fprintf (fp, "/* Do not edit this file manually.\n" @@ -773,12 +773,10 @@ write_rc (FILE *fp) if (! mc_nodes_lang_count) return; n = NULL; - i = 0; for (l = 0; l < mc_nodes_lang_count; l++) { if (n && n->lang == mc_nodes_lang[l]->lang) continue; - ++i; n = mc_nodes_lang[l]; fprintf (fp, "\n// Country: %s\n// Language: %s\n#pragma code_page(%u)\n", n->lang->lang_info.country, n->lang->lang_info.name, -- cgit v1.1