[cfe-dev] [PATCH] Check missing or extra releases of ivars in dealloc

Nikita Zhuk nikita at zhuk.fi
Thu Oct 30 02:17:26 PDT 2008


The attached patch fixes false positives reported in http://llvm.org/bugs/show_bug.cgi?id=2978

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-dealloc-check.patch
Type: application/octet-stream
Size: 3852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081030/0a0c573b/attachment.obj>
-------------- next part --------------




On 29.10.2008, at 15.20, Thomas Clement wrote:

> On Oct 29, 2008, at 5:32 AM, Ted Kremenek wrote:
>
>> On Oct 24, 2008, at 8:17 AM, Nikita Zhuk wrote:
>>
>>> Hi,
>>>
>>> The attached patch adds additional checks to -warn-objc-missing-
>>> dealloc. It checks that all ivars which are used in implementation
>>> of synthesized properties are either
>>> a) released in dealloc if the property has retain" or "copy"
>>> attribute OR
>>> b) not released in dealloc if the property has "assign" attribute
>>>
>>> If it looks useful to you, please review & include it into clang.
>>>
>>>
>>
>> Hi Nikita,
>>
>> Other than adding a "bug category" for these warnings, I basically
>> applied the patch as is:
>>
>>  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20081027/008677.html
>>
>> We will continue to evolve the -dealloc checks over time, and this is
>> a great addition!
>
> Also classes with only 'assigned' properties should not be flagged  
> as missing a dealloc method.
> I filled a bug report about that a few days ago (2956).
>
> Regards,
> Thomas
>



More information about the cfe-dev mailing list