[RFA 6/6] Add -Wunused-but-set-* to build

Trevor Saunders tbsaunde@tbsaunde.org
Wed Jun 8 03:18:00 GMT 2016


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



More information about the Gdb-patches mailing list