[cfe-commits] [patch] Retain/release checking for ObjCStringLiterals

Ted Kremenek kremenek at apple.com
Mon Mar 12 16:18:05 PDT 2012


On Mar 12, 2012, at 9:44 AM, Jordan Rose <jediknil at belkadan.com> wrote:

> On Mar 12, 2012, at 1:44, Jean-Daniel Dupas wrote:
> 
>> Le 11 mars 2012 à 22:37, Jordan Rose a écrit :
>> 
>>> After I complained about it a few days ago, I figured I'd take a stab at fixing this:
>>> 
>>> [@"abc" release]; // should warn!
>> 
>> I'm not sure I agree it should warn. It is a well known fact that retain/release are noop on constant string literal and it is used in many place.
>> 
>> IHMO, the static analyzer should continue to ignore String literals as it actually does.
> 
> Hm. I don't like it cause it smells like bad style to me, but you're right; I forgot that this was documented behavior:

I agree that we should not warn about this if this is documented behavior.  It distracts users for useful results from the analyzer, even if it is bad style.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120312/16f0da5e/attachment.html>


More information about the cfe-commits mailing list