<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Book Antiqua";
panose-1:2 4 6 2 5 3 5 3 3 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Book Antiqua",serif;
color:#943634;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Book Antiqua",serif;
color:#943634;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>Typo:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>and invoked ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>scan-build</span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>’ as follows:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>scan-build --use-cc clang --use-c++ clang++ -v -v -v -o check make build</span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Martin J. O'Riordan [mailto:martin.oriordan@movidius.com] <br><b>Sent:</b> 12 November 2016 19:18<br><b>To:</b> 'ganna@apple.com' <ganna@apple.com><br><b>Cc:</b> 'Aleksei Sidorin' <a.sidorin@samsung.com>; 'cfe-dev' <cfe-dev@lists.llvm.org><br><b>Subject:</b> RE: [cfe-dev] Learning how to use and deploy 'scan-build'<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>I changed my test case to just:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>int main () {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> int zero = 0;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> return 5 / 0;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>and invoked ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>scan-build</span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>’ as follows:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>scan-build --use-cc clang --use-c++ = clang++ -v -v -v -o check make build<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>and this causes a warning from the compiler:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>ANALYZE (Syntax): testScanBuild.cpp main<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>ANALYZE (Path, Inline_Regular): testScanBuild.cpp main<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>testScanBuild.cpp:350:12: warning: Division by zero<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> return 5 / zero;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> ~~^~~~~~<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>1 warning generated.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>But I still get the message stating:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>scan-build: Removing directory '<<i>test-cygpath</i>>/ScanBuild/check/2016-11-12-190818-7508-1' because it contains no reports.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>scan-build: No bugs found.</span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>Omitting the ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>-enable-checker</span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>’ option enables the following checkers (by default):<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-store=region<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-opt-analyze-nested-blocks<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-eagerly-assume<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=core<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=unix<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=deadcode<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=cplusplus<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=security.insecureAPI.UncheckedReturn<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=security.insecureAPI.getpw<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=security.insecureAPI.gets<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=security.insecureAPI.mktemp<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=security.insecureAPI.mkstemp<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=security.insecureAPI.vfork<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=nullability.NullPassedToNonnull<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'> -analyzer-checker=nullability.NullReturnedFromNonnull<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>This is strange, because the compiler clearly detects the issue and warns, but I am not getting a report, so something else must be broken in my configuration. I have not altered any of the Perl scripts.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>I get the same results running on Linux (CentOS 7).<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'> MartinO<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> <a href="mailto:ganna@apple.com">ganna@apple.com</a> [<a href="mailto:ganna@apple.com">mailto:ganna@apple.com</a>] <br><b>Sent:</b> 12 November 2016 18:19<br><b>To:</b> <a href="mailto:Martin.ORiordan@Movidius.com">Martin.ORiordan@Movidius.com</a><br><b>Cc:</b> Aleksei Sidorin <<a href="mailto:a.sidorin@samsung.com">a.sidorin@samsung.com</a>>; cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br><b>Subject:</b> Re: [cfe-dev] Learning how to use and deploy 'scan-build'<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>I recommend not limiting the analysis to these 2 packages unless you see that the other packages turned on by default report false positives on your codebase.<o:p></o:p></p></div></div><div><p class=MsoNormal><br>The checkers you’ve enabled will not find this bug. Try testing with devision by zero or null pointer dereference:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>int x = 0;<o:p></o:p></p></div><div><p class=MsoNormal>return 5/x;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>or <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>int *x = 0;<o:p></o:p></p></div><div><p class=MsoNormal>*x = 5;<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>