[cfe-dev] Opinions requested -- nullability analysis in Clang

Craig, Ben via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 9 06:29:54 PST 2015


On 11/6/2015 5:17 PM, George Burgess IV wrote:
> > I like static analysis, but I do not think the static analysis 
> available in clang today for null checking is suitable for -Wall.  One 
> of the reasons is because it is difficult to silence false positives 
> (as you mentioned).  More importantly though, the impact to build time 
> is quite substantial.  Nullability checks are path sensitive, and path 
> sensitive checks are super-exponential.  If a file takes seconds to 
> compile, it is fairly common for it to take minutes to analyze.
>
> Sorry, I didn't express myself clearly. The idea was more to make a 
> new pass check like the uninitialized value check, but checking for 
> nulls rather than "has this been assigned?" -- it's going to be a 
> low-quality analysis, but I'd think it should be able to catch trivial 
> cases without eating too many cycles.
If you can keep the number of false positives low and the speed quick, 
then this seems reasonable and useful to me.

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151109/05bba93d/attachment.html>


More information about the cfe-dev mailing list