This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [RFC PATCH] Add set but not used warning support for the C FE (PR c/18624)


On Wed, Nov 25, 2009 at 10:44:56AM +0000, d binderman wrote:
> >attached is a list of these warnings during bootstrap
> 
> There are over 400 of them. It looks to me like all of these need fixing,
> to get this patch into the mainstream bootstrap. That's quite a lot of work.

True, but e.g. many of them are solvable in just one spot (e.g. all
_operandN unused in insn-emit.c is one fix, etc.), and some aren't in files
compiled with -Werror (e.g. libbid, soft-fp).

> >I wonder whether we want to control this warning with a separate -Wunused-* switch
> 
> If you invent a new name, then folks initially won't use it.

Having a separate option to control it has the advantage that it can be
separately turned off or on.  It could certainly be included in -Wunused,
like -Wunused-variables and -Wunused-parameters is (-Wunused-set-variables
and -Wunused-set-parameters ??).

> >If anyone has suggestions what else should be tested in
> >the testsuite of this warning
> 
> How about this one
> 
> static int fred;
> 
> void
> f()
> {
>     fred = 1;
> }
> /*no more uses of fred */
> 
> where file static data is set but not used, might also be worth a warning,
> even if only with -Os.

This would need to wait until all FEs set the flag, because the checking
would need to be performed again in generic code.

	Jakub


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