[cfe-dev] Implementing -Wunused-variables

Oscar Bonilla ob at bitmover.com
Thu Oct 8 14:48:39 PDT 2009


On Oct 8, 2009, at 2:38 PM, Douglas Gregor wrote:

>
> On Oct 6, 2009, at 9:12 AM, Oscar Bonilla wrote:
>
>> On Oct 5, 2009, at 11:37 PM, Oscar Bonilla wrote:
>>
>>> On Oct 5, 2009, at 9:46 PM, Oscar Bonilla wrote:
>>>
>>>> Is this any better?
>>>
>>> Still not quite right:
>>
>> Ok, this one seems to do the trick:
>>
>> <ob.patch>
>>
>> Testcases:
>>
>> <warn-unused-variables.c><warn-unused-variables.cpp>
>>
>> I ran "make test" and only got one failure:
>>
>> FAIL: Clang::Index/c-index-api-test.m (646 of 1636)
>>
>> which seems unrelated. I also compiled Adium with it and didn't get  
>> any obvious false positives or false negatives.
>
> Wonderful, thank you! I've committed this patch here:
>
> 	http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091005/022108.html
>
> along with your suggested micro-optimization. We love optimizations  
> of all kinds, and moving the isUsed() check first will save a lot of  
> isa<> checks. Good catch!

Thanks. I have some other warning fixes that I'll post here (is here  
the best place?).

Also, should I close the bug? http://llvm.org/bugs/show_bug.cgi? 
id=4563 or is there someone responsible for that?

Cheers,

-Oscar




More information about the cfe-dev mailing list