<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Arjun,<div><br></div><div>You could look at the Bugzilla enhancement requests and see if you can find something interesting. For example, here are several checker requests:</div><div><br></div><div><div><span id="summary_alias_container" style="font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(208, 208, 208); color: rgb(0, 0, 0); "><span id="summary_alias_container" style="color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(208, 208, 208); "><span id="short_desc_nonedit_display"><span id="summary_alias_container" style="color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(208, 208, 208); "><span id="short_desc_nonedit_display"><div style="font-style: normal; font-size: large; font-family: Verdana, sans-serif; ">Bug 9510 - Warning for ctype.h misuse </div><div style="font-style: normal; font-size: large; font-family: Verdana, sans-serif; ">Bug 9544 - Static Analyzer should warn about usage of weak symbols without check</div><div style="font-style: normal; font-size: large; font-family: Verdana, sans-serif; ">Bug 5067 - clang/C++: issue warning when iterators from different variables are compared</div><div style="font-style: normal; font-size: large; font-family: Verdana, sans-serif; "><br></div><div>Keep in mind that the analyzer is currently limited to intra-procedural reasoning. (For example, some of the checks might have a high false positive rate due to that and should be avoided for now.) </div><div><br></div><div>You can also send a proposal to the list with more details on what you want to check for.</div><div><br></div><div>Cheers,</div><div>Anna.</div></span></span></span></span></span></div><div><div>On Oct 1, 2011, at 8:50 AM, Arjun Singri wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Can you please give me some ideas for checkers to implement?<div><br></div><div>Thanks,</div><div>Arjun<br><br><div class="gmail_quote">On Sat, Oct 1, 2011 at 12:13 AM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Arjun,<div><br></div><div>Currently, the clang static analyzer only performs intra-procedural analysis. I don't think that any other checkers in the analyzer use CallGraph, so you might need a bit of extra plumbing to construct one.</div>


<div><br></div><div>Also, I am not sure if the checker you are working on is going to be different from the compiler warning:</div><div><br></div><div><div>$ clang -Wall ~/tmp/example.c </div><div>/Users/zaks/tmp/example.c:5:12: warning: unused function 'xxx' [-Wunused-function]</div>


<div>static int foo() {return 3;}</div><div><br></div><div>Cheers,</div><div>Anna.</div><div><div><div>On Sep 30, 2011, at 10:36 PM, Arjun Singri wrote:</div><br><blockquote type="cite">Hi,<br><br>Thank you for replying. I will keep that in mind when writing the checker. <div>


<br></div><div>To use the CallGraph class I need to supply it an object of type "Program". The only way I can get a Program object is through the Indexer object which itself is obtained from AnalysisManager. But when the AnalysisManager object is constructed in Frontend/AnalysisConsumer.cpp:148, a value of zero is passed for the Indexer making the Indexer NULL. Why is this? Can I get a reference to the Program object any other way?<div>




<br></div><div>Thanks,</div><div>Arjun<br><br><div class="gmail_quote">On Fri, Sep 30, 2011 at 2:09 PM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi Arjun,<br>
<br>
scan-build is a script that hijacks the build system to call the static analyzer. Currently, the analyzer can only reason about one translation unit at a time.<br>
<br>
So there is no reason to have multiple roots to represent different main functions. In addition, your checker would/should only be applicable to functions with internal linkage.<br>
<br>
Cheers,<br>
Anna.<br>
<div><div></div><div><br>
On Sep 30, 2011, at 12:58 PM, Arjun Singri wrote:<br>
<br>
> Hi,<br>
><br>
> I am currently trying to implement a checker that detects unused methods. I am making use of the CallGraph class for this. Every time CallGraph detects the "main" function, it designates it as the root node. Considering that scan-build accepts multiple files each having a main function, does it make sense to modify CallGraph to have mutlple root nodes?<br>






><br>
> Thanks,<br>
> Arjun<br>
</div></div>> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</blockquote></div><br>
</div></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></body></html>