diff options
author | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-09-15 04:06:09 +0000 |
---|---|---|
committer | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-09-15 10:46:02 +0000 |
commit | d0975d800285f61d60cd7c3f47b185304a09a052 (patch) | |
tree | 74556dfedb7bb73d1515f3f21067bc6a9f09959e /bfd | |
parent | fe39ffdc202f04397f31557f17170b40bc42b77a (diff) | |
download | gdb-d0975d800285f61d60cd7c3f47b185304a09a052.zip gdb-d0975d800285f61d60cd7c3f47b185304a09a052.tar.gz gdb-d0975d800285f61d60cd7c3f47b185304a09a052.tar.bz2 |
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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/elf32-lm32.c | 2 | ||||
-rw-r--r-- | bfd/elf32-nds32.c | 3 | ||||
-rw-r--r-- | bfd/mmo.c | 2 |
3 files changed, 2 insertions, 5 deletions
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index 4830ab2..64b3ede 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -2067,7 +2067,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd, struct weak_symbol_list *list_start = NULL, *list_end = NULL; int rgot_weak_count = 0; int r32_count = 0; - int rgot_count = 0; + int rgot_count ATTRIBUTE_UNUSED = 0; /* Look for deleted sections. */ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c index 82c2059..35e0302 100644 --- a/bfd/elf32-nds32.c +++ b/bfd/elf32-nds32.c @@ -13460,7 +13460,6 @@ elf32_nds32_unify_relax_group (bfd *abfd, asection *asec) Elf_Internal_Rela *relocs = NULL; enum elf_nds32_reloc_type rtype; struct section_id_list_t *node = NULL; - int count = 0; do { @@ -13499,8 +13498,6 @@ elf32_nds32_unify_relax_group (bfd *abfd, asection *asec) /* Change it. */ rel->r_addend += relax_group_ptr->bias; - /* Debugging count. */ - count++; } } while (false); @@ -1602,7 +1602,7 @@ static bool mmo_scan (bfd *abfd) { unsigned int i; - unsigned int lineno = 1; + unsigned int lineno ATTRIBUTE_UNUSED = 1; bool error = false; bfd_vma vma = 0; asection *sec = NULL; |