Re: static analyzer
Re: static analyzer
- Subject: Re: static analyzer
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 07 Jul 2010 11:35:25 -0700
On Jul 7, 2010, at 11:33 AM, Matt Neuburg wrote:
> On or about 7/7/10 11:17 AM, thus spake "Bill Bumgarner" <email@hidden>:
>
>> I missed the OP's post....
>>
>> If the static analyzer is barfing up a false positive, please report it
>> (http://bugreport.apple.com/ works fine).
>
> Is that generally true? I mean, first of all, false positives are a
> well-known phenomenon with this static analyzer (the Web page at llvm.org
> talks about this). Second, they do no harm. I get a false positive in *any*
> of my apps that uses NSURLConnection, for example:
Yup. That is really true. False positives are taken very seriously.
> That triggers a "potential leak" warning. Well, of course it is a
> *potential* leak. But it isn't a *real* leak, because I happen to know that
> I'm going to release this object in either connection:didFailWithError: or
> connectionDidFinishLoading:. (My code and memory management come right out
> of Apple's own examples here.) I know how NSURLConnections work; the static
> analyzer doesn't. But I would hardly call that a bug.
The static analyzer can be taught about the idiosyncrasies of NSURLConnection.
While the compilers are all about generically compiling code and making sure your code can be predictably evaluated within the defines of the standard and mores of the language, the static analyzer is very much all about making sure your code is behaving appropriately within the confines of the targeted APIs.
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden