From 6fca4d9694bf6d10d1cc41aed8552fe90085eb09 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 15 Mar 2025 18:13:41 -0400 Subject: gdbsupport: add some -Wunused-* warning flags Add a few -Wunused-* diagnostic flags that look useful. Some are known to gcc, some to clang, some to both. Fix the fallouts. -Wunused-const-variable=1 is understood by gcc, but not clang. -Wunused-const-variable would be undertsood by both, but for gcc at least it would flag the unused const variables in headers. This doesn't make sense to me, because as soon as one source file includes a header but doesn't use a const variable defined in that header, it's an error. With `=1`, gcc only warns about unused const variable in the main source file. It's not a big deal that clang doesn't understand it though: any instance of that problem will be flagged by any gcc build. Change-Id: Ie20d99524b3054693f1ac5b53115bb46c89a5156 Approved-By: Tom Tromey --- gdb/dwarf2/index-write.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gdb/dwarf2/index-write.c') diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index 8fb5931..da1f6cd 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -887,8 +887,7 @@ private: /* Object constructor to be called for current DWARF2_PER_BFD. */ debug_str_lookup (dwarf2_per_bfd *per_bfd) - : m_abfd (per_bfd->obfd), - m_per_bfd (per_bfd) + : m_per_bfd (per_bfd) { } @@ -922,7 +921,6 @@ private: private: gdb::unordered_map m_str_table; - bfd *const m_abfd; dwarf2_per_bfd *m_per_bfd; /* Data to add at the end of .debug_str for new needed symbol names. */ -- cgit v1.1