<div dir="ltr"><div>Hi,</div><div><br></div><div>When there is a fatal error found in the code there is no way to meaningfully update the analysis state and continue the analysis. This implies once the analyzer finds a fatal error on a path the analysis will stop there and no additional bugs will be reported from that path. This is by design and the alternatives we have would introduce additional false positives.</div><div><br></div><div>If you have compilation errors, you do not have a complete representation of the code in Clang. The static analyzer does not support the analysis of incomplete ASTs. Running the analyzer on incomplete AST would result in spurious warnings and bad user experience.</div><div><br></div><div>Cheers,</div><div>Gabor<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 5 Oct 2019 at 10:37, <a href="mailto:jiancai.hao@isemp.com">jiancai.hao@isemp.com</a> via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div><span></span>Hi, Dear cfe-dev,</div><div><br></div><div>For Clang Static Analyzer, we are interested in it very much. I'm planning to implements such checking ways for my projects:</div><div><br></div><div>(1) When there are two same defects in the same function, we hope to find and report them all out, for example, if there are two divided by zero errors:</div><div><br></div><div>int main() {</div><div> int n = 0;</div><div> int a = 10;</div><div> a = a/n; // Clang Static Analyzer will report div zero bug here, and will stop to check the following codes.</div><div> a = 10/n; // I hope to report this div zero bug also, how to do?</div><div>}</div><div><br></div><div>(2) I hope to continue to complete the static analysis, even if the source code has compling errors, how to deal with it?</div><div><br></div><div>Regards,</div><div><br></div>
<hr style="width:210px;height:1px" size="1" color="#b5c4df" align="left">
<div><span><a href="mailto:jiancai.hao@isemp.com" target="_blank">jiancai.hao@isemp.com</a></span></div>
</div>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>