This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 6/6] Add -Wunused-but-set-* to build
- From: Trevor Saunders <tbsaunde at tbsaunde dot org>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 7 Jun 2016 23:24:56 -0400
- Subject: Re: [RFA 6/6] Add -Wunused-but-set-* to build
- Authentication-results: sourceware.org; auth=none
- References: <1465248812-23902-1-git-send-email-tom at tromey dot com> <1465248812-23902-7-git-send-email-tom at tromey dot com> <20160608023751 dot GC30231 at ball> <87shwo5rec dot fsf at tromey dot com>
On Tue, Jun 07, 2016 at 08:46:35PM -0600, Tom Tromey wrote:
> >>>>> "Trevor" == Trevor Saunders <tbsaunde@tbsaunde.org> writes:
>
> Trevor> isn't everything in -Wunused enabled now? can we just delete
> Trevor> -Wno-unused and use -Wall to get us -Wunused?
>
> I didn't think of that -- thanks. From the gcc docs I see
> -Wunused-label, -Wunused-local-typedefs, and -Wunused-parameter. That
> final one seems difficult for gdb given the many functions that are
> called via function pointers but which do not use all their arguments.
the docs for -Wunused-parameter are... tricky, but I believe what they
say is -Wall -Wunused does not enable -Wunused-parameter, to enable
-Wunused-parameter you either need to pass it explicitly, or pass
-Wextra -Wunused.
> Once the switch to C++ is complete, such parameters could be nameless.
> To me that seems better than sticking ATTRIBUTE_UNUSED in many places.
I'd agree, and at that point it might make sense to enable
-Wunused-parameter.
Trev
>
> Tom