<div dir="ltr"><a href="http://clang.llvm.org/extra/clang-tidy/index.html#choosing-the-right-place-for-your-check" target="_blank">http://clang.llvm.org/extra/clang-tidy/index.html#choosing-the-right-place-for-your-check</a>:<div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><p style="text-align:justify;color:rgb(51,51,51);font-family:'DejaVu Sans',Arial,Helvetica,sans-serif;font-size:14.4px;line-height:21.6px">If you have an idea of a check, you should decide whether it should be implemented as a:</p><ul style="padding-left:5px;margin-top:3px;color:rgb(51,51,51);font-family:'DejaVu Sans',Arial,Helvetica,sans-serif;font-size:14.4px;line-height:21.6px"><li style="line-height:1.3;list-style-type:none;padding:0px 0px 0px 1.666em;margin-bottom:3px;background:url(http://clang.llvm.org/extra/_static/bullet_orange.png) 0% 0.45em no-repeat scroll transparent"><em>Clang diagnostic</em>: if the check is generic enough, targets code patterns that most probably are bugs (rather than style or readability issues), can be implemented effectively and with extremely low false positive rate, it may make a good Clang diagnostic.</li><li style="line-height:1.3;list-style-type:none;padding:0px 0px 0px 1.666em;margin-bottom:3px;background:url(http://clang.llvm.org/extra/_static/bullet_orange.png) 0% 0.45em no-repeat scroll transparent"><em>Clang static analyzer check</em>: if the check requires some sort of control flow analysis, it should probably be implemented as a static analyzer check.</li><li style="line-height:1.3;list-style-type:none;padding:0px 0px 0px 1.666em;margin-bottom:3px;background:url(http://clang.llvm.org/extra/_static/bullet_orange.png) 0% 0.45em no-repeat scroll transparent"><em>clang-tidy check</em> is a good choice for linter-style checks, checks that are related to a certain coding style, checks that address code readability, etc.</li></ul></blockquote><div class="gmail_extra">A few notable differences:</div><div class="gmail_extra"> * clang-tidy supports fix-it hints, while static analyzer doesn't<br></div><div class="gmail_extra"> * clang-tidy checks can operate AST and preprocessor information, while Clang static analyzer checkers can additionally inspect control flow graph and do path-based analysis, which allows for much </div><div class="gmail_extra"> * static analyzer supports more advanced output formats (html, plist), while clang-tidy supports only plain text and yaml (suitable for clang-apply-replacements)</div><div class="gmail_extra"><div class="gmail_extra"> * if you're fine with plain text, clang-tidy can be used as a frontend for the static analyzer checkers (they are called clang-analyzer-<static-analyzer-checker-name>). This is probably the overlap you were talking about.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Alex</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 4, 2015 at 5:52 PM, Rob Conde via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<p>I was wondering if someone could comment on or point to any resources on the relationship between clang-tidy and the clang static analyzer as they seem to have overlap.<br>
</p>
<p><br>
</p>
<p>Thanks,<br>
</p>
<p>Rob Conde<br>
</p>
</div>
</div>
<br>_______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br>
</div></div></div>