This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]