Hi Vu LE,<br><br>You should add you checker in clang/lib/StaticAnalyzer/Checkers/Checkers.td, and implement a function to register it as the error says.<br><br><div class="gmail_quote">2011/3/9 Vu Le <span dir="ltr"><<a href="mailto:minhvule@gmail.com">minhvule@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hi Ted,</div>Thank you for your fast response.<div><br><div>I add a new file UnhandledMemoryWarningChecker.cpp under Checker.</div>
<div>Rebuilding Clang generates this error</div><div><div><i>UnhandledMemoryWarningChecker.cpp:59: error: ‘void clang::ento::registerUnhandledMemoryWarningChecker(clang::ento::CheckerManager&)’ should have been declared inside ‘clang::ento’</i></div>

<div><div><br></div></div></div><div>I couldn't find the documentation for adding a new Checker.</div><div>What are the steps to define a new checker?</div>
<div><br></div><div>Thanks again.</div><div>Vu</div><div><div></div><div class="h5"><div><br></div><div><div class="gmail_quote">On Mon, Mar 7, 2011 at 7:20 PM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com" target="_blank">kremenek@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="word-wrap: break-word;">Take a look at CheckObjCDealloc.cpp, which warns about incomplete -dealloc implementations.  Diagnostics still need a source location, but they can refer to the location of the @interface or @implementation (for example).<br>

<div><br><div><div><div></div><div><div>On Mar 7, 2011, at 4:28 PM, Vu Le wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div>Hi all,<div><br></div><div>I want to write a checker that checks whether a handler method, </div>

<div>for example "<span style="border-collapse: collapse; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size: 12px; line-height: 13px; white-space: pre-wrap;">didReceiveMemoryWarning", has been implemented.</span></div>


<div><span style="border-collapse: collapse; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size: 12px; line-height: 13px; white-space: pre-wrap;"><br>
</span></div><div><span style="border-collapse: collapse; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size: 12px; line-height: 13px; white-space: pre-wrap;">Based on what I read from the source code, most checkers find</span></div>


<div><span style="border-collapse: collapse; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size: 12px; line-height: 13px; white-space: pre-wrap;">violations in a specific location. Is there a way to check</span></div>


<div><span style="border-collapse: collapse; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size: 12px; line-height: 13px; white-space: pre-wrap;">the absence of implementing handler?</span></div>


<div><span style="border-collapse: collapse; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size: 12px; line-height: 13px; white-space: pre-wrap;"><br>
</span></div><div><font face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><span style="border-collapse: collapse; font-size: 12px; line-height: 13px; white-space: pre-wrap;">Thanks.</span></font></div>


<div><font face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><span style="border-collapse: collapse; font-size: 12px; line-height: 13px; white-space: pre-wrap;">Vu Le</span></font></div>


</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>

</blockquote></div><br></div></div></blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">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><br clear="all"><br>-- <br>Best regards!<br><br>Lei Zhang<br>