[cfe-dev] [Patch] Generate a warning if a message is sent to a nil receiver with return type larger than void* (PR 2718)

Valeri Zhuk nikita at zhuk.fi
Tue Apr 7 11:23:25 PDT 2009


The attached patch generates warnings of cases where an ObjC message  
is sent to a nil object and the size of return type of that message is  
larger than the size of void pointer. This may result in undefined  
return values as described in PR 2718 [1]. The patch also includes  
test cases.

Warnings are currently generated only in those cases where we know for  
sure that an object pointer is nil. Enabling this warning in all  
possible nil cases would probably produce too many false positives.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-nil-checker.patch
Type: application/octet-stream
Size: 8006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090407/9b9c4fe3/attachment.obj>
-------------- next part --------------





[1] http://llvm.org/bugs/show_bug.cgi?id=2718



More information about the cfe-dev mailing list