[cfe-dev] Self-init check should only run on NSObject subclasses

Jean-Daniel Dupas devlists at shadowlab.org
Thu Jan 27 00:35:53 PST 2011


Thank you for the fix, and for the commit.

Le 26 janv. 2011 à 00:58, Argyrios Kyrtzidis a écrit :

> Committed with that change in r124249. Thanks!
> 
> -Argiris
> 
> On Jan 25, 2011, at 3:47 PM, Argyrios Kyrtzidis wrote:
> 
>> On Jan 25, 2011, at 3:09 AM, Jean-Daniel Dupas wrote:
>> 
>>> 
>>> Actually, the self-init check is performed on all classes. But NSProxy does not even implement -init. So, in proxy subclasses, it is not possible to call [super init].
>>> I attach a patch to disable this check on classes that does not inherit NSObject.
>> 
>> Looks good, apart from a nitpick:
>> 
>> -  if (!MD->getClassInterface()->getSuperClass())
>> +
>> +  // self = [super init] applies only to NSObject subclasses.
>> +  // For instance, NSProxy doesn't implement -init.
>> +  ASTContext& Ctx = C.getASTContext();
>> 
>> You can get the ASTContext using MD->getASTContext() and avoid passing "CheckerContext &C" around.
>> 
>> -Argiris
>> 
>> 
>>> 
>>> -- Jean-Daniel
>>> 
>>> 
>>> 
>>> <self-init.patch>_______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>> 
>> 
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 

-- Jean-Daniel








More information about the cfe-dev mailing list