]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbsupport: add some -Wunused-* warning flags
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 15 Mar 2025 22:13:41 +0000 (18:13 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 17 Mar 2025 20:14:08 +0000 (16:14 -0400)
commit6fca4d9694bf6d10d1cc41aed8552fe90085eb09
tree124548e579158904baa1a362ca1bf9e70c3c1b2a
parentdf3eb64a53c3589f4e930a89e08e2200e8627509
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 <tom@tromey.com>
13 files changed:
gdb/configure
gdb/dwarf2/cooked-index.c
gdb/dwarf2/cooked-index.h
gdb/dwarf2/index-write.c
gdb/dwarf2/read.c
gdb/dwarf2/read.h
gdb/elfread.c
gdb/mi/mi-out.c
gdb/mi/mi-out.h
gdb/symfile-debug.c
gdbserver/configure
gdbsupport/configure
gdbsupport/warning.m4