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)



Hello there,

Jakub wrote:
>The attached patch is my initial attempt at adding the set but not used warning

Excellent work.

>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.

>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.

It will get a lot more use if it goes into -Wunused or even -Wall.

It depends how soon you want to go mainstream with it.

>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.

I'd be happy for your current patch to go ahead as is, but if it's not much extra work
it might be worth enhancing your patch to warn for the above source code too.


Regards

David Binderman
 		 	   		  
_________________________________________________________________
Use Hotmail to send and receive mail from your different email accounts
http://clk.atdmt.com/UKM/go/186394592/direct/01/


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