[cfe-dev] Missing dealloc analysis

Ted Kremenek kremenek at apple.com
Thu Jul 3 09:02:48 PDT 2008


On Jul 3, 2008, at 3:39 AM, David Chisnall wrote:

> On 3 Jul 2008, at 06:35, Nikita Zhuk wrote:
>
>> It's a
>> good idea to check that dealloc is implemented and that it always
>> calls [super dealloc]
>
> One minor point:
>
> GCC emits a warning if -dealloc does not call [super dealloc], which
> is very frustrating when you are creating a root class (or a category
> on a root class) for which super is invalid, since it seems impossible
> to suppress the warning.  Please don't replicate this bug!


Right now the check only applies to ObjCImplementationDecls  
(@implementation for those not familiar with clang internals).  The  
check walks the super chain to see if the class is a subclass of  
NSObject.  Classes that don't subclass NSObject (including root  
classes) are skipped by this check.




More information about the cfe-dev mailing list