<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:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:Menlo;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* 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;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Book Antiqua","serif";
font-variant:normal !important;
color:windowtext;
text-transform:none;
font-weight:normal;
font-style:normal;
text-decoration:none none;
vertical-align:baseline;}
.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";mso-fareast-language:EN-US'>Thanks Anna,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>I have it all working really well now, but I want to make sure that I have not broken anything else, so I will wait until I have tried some other scenarios before proposing a general patch; one case that occurred to me is when ‘</span><span style='font-family:"Courier New";mso-fareast-language:EN-US'>clang.exe</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>’ is built with the Cygwin or MINGW version of GCC my patch might break them, or at the very least result in warnings about the path conventions. I think I can make this more adaptive by examining the output from the ‘</span><span style='font-family:"Courier New";mso-fareast-language:EN-US'>-###</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>’ invocation and make the ‘</span><span style='font-family:"Courier New";mso-fareast-language:EN-US'>cygpath</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>’ trick automatic and appropriate to the actual compiler.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>The feedback I got from you all on this has my build working very nicely now </span><span style='font-family:Wingdings;mso-fareast-language:EN-US'>J</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'> MartinO<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";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"'> ganna@apple.com [mailto:ganna@apple.com] <br><b>Sent:</b> 14 November 2016 19:42<br><b>To:</b> Martin.ORiordan@Movidius.com<br><b>Cc:</b> cfe-dev; Aleksei Sidorin; Laszlo Nagy<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><p class=MsoNormal>Great to hear that you found a solution!<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>Feel free to submit a patch; it might help others with the same setup:<o:p></o:p></p><div><div><p class=MsoNormal><a href="http://llvm.org/docs/Phabricator.html">http://llvm.org/docs/Phabricator.html</a><o:p></o:p></p></div><div><p class=MsoNormal><a href="http://llvm.org/docs/DeveloperPolicy.html">http://llvm.org/docs/DeveloperPolicy.html</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Anna.<o:p></o:p></p><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>On Nov 13, 2016, at 2:55 AM, Martin J. O'Riordan <<a href="mailto:Martin.ORiordan@movidius.com">Martin.ORiordan@movidius.com</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>Following up on this, I have made a change to my local copy of ‘</span><span style='font-family:"Courier New"'>ccc-analyzer</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ that compensates for the Windows vs Cygwin path differences. In the subroutine ‘</span><span style='font-family:"Courier New"'>sub Analyze</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ I have changed the lines:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> # Create arguments for doing static analysis.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> if (defined $ResultFile) {</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> push @Args, '-o', $ResultFile;</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> }</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> elsif (defined $HtmlDir) {</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> push @Args, '-o', $HtmlDir;</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> }</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>to:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> # Create arguments for doing static analysis.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> if (defined $ResultFile) {</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> push @Args, '-o', $ResultFile;</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> }</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> elsif (defined $HtmlDir) {</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>+ # Convert the output path to the Windows form on Cygwin</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>+ if ($^O =~/cygwin/) {</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>+ my $winHtmlDir = `cygpath -m $HtmlDir`;</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>+ $winHtmlDir =~ tr/\n\r//d; # Strip newlines</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>+ push @Args, '-o', $winHtmlDir;</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>+ } else {</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> push @Args, '-o', $HtmlDir;</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'>+ }</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Courier New"'> }</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>I have used ‘</span><span style='font-family:"Courier New"'>tr</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ rather than ‘</span><span style='font-family:"Courier New"'>chomp</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ because I have found that ‘</span><span style='font-family:"Courier New"'>chomp</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ does not always remove CRs and is not as robust as using this ‘</span><span style='font-family:"Courier New"'>tr</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ pattern. Also, I use the ‘</span><span style='font-family:"Courier New"'>-m</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ option to ‘</span><span style='font-family:"Courier New"'>cygpath</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ rather than ‘</span><span style='font-family:"Courier New"'>-w</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ because it uses the ‘</span><span style='font-family:"Courier New"'>/</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ character for directory path separators rather than ‘</span><span style='font-family:"Courier New"'>\</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’. The latter causes all sorts of trouble in Perl, Python, Bash and so on; while Windows applications are perfectly happy with the ‘</span><span style='font-family:"Courier New"'>/</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ character (WIN32’s file open functions accept either).</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>All the best and thanks to each of you for your advice and help,</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> MartinO</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><div><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span class=apple-converted-space><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span></span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Martin J. O'Riordan [<a href="mailto:martin.oriordan@movidius.com"><span style='color:purple'>mailto:martin.oriordan@movidius.com</span></a>]<span class=apple-converted-space> </span><br><b>Sent:</b><span class=apple-converted-space> </span>12 November 2016 21:48<br><b>To:</b><span class=apple-converted-space> </span>'<a href="mailto:ganna@apple.com"><span style='color:purple'>ganna@apple.com</span></a>' <<a href="mailto:ganna@apple.com"><span style='color:purple'>ganna@apple.com</span></a>><br><b>Cc:</b><span class=apple-converted-space> </span>'Aleksei Sidorin' <<a href="mailto:a.sidorin@samsung.com"><span style='color:purple'>a.sidorin@samsung.com</span></a>>; 'cfe-dev' <<a href="mailto:cfe-dev@lists.llvm.org"><span style='color:purple'>cfe-dev@lists.llvm.org</span></a>><br><b>Subject:</b><span class=apple-converted-space> </span>RE: [cfe-dev] Learning how to use and deploy 'scan-build'</span><o:p></o:p></p></div></div></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>Hi again. I have solved the problem that I was having but it is obscure so I will explain here.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>Turns out that the problem I am having is a consequence of Windows versus Cygwin paths. Running the same scenario on Linux is fine (after I had an example with something worth reporting).</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>In summary the issue is the path that is passed using ‘</span><span style='font-family:"Courier New"'>-o</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ to the Visual Studio built ‘</span><span style='font-family:"Courier New"'>clang.exe</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ which only understands Windows paths, but at line #1490 in ‘</span><span style='font-family:"Courier New"'>scan-build</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ the path is constructed using:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>$Options{OutputDir} = abs_path($OutDir);</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>In my case the path for ‘</span><span style='font-family:"Courier New"'>-o check</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ becomes:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>/src/tests/ScanBuild/check</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>But in my Cygwin setup, ‘</span><span style='font-family:"Courier New"'>/src/</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ is actually a ‘</span><span style='font-family:"Courier New"'>mount</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ of the directory ‘</span><span style='font-family:"Courier New"'>S:\Projects\</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ - I use mounts so that my scripts are portable across Linux and Windows systems. I tend to live in the ‘</span><span style='font-family:"Courier New"'>bash</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ shell on Windows and Linux. If I was passing the path to ‘</span><span style='font-family:"Courier New"'>clang.exe</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ from a Makefile, I would typically use ‘</span><span style='font-family:"Courier New"'>cygpath -m</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ to get the Windows path, but because this is happening in the generic ‘</span><span style='font-family:"Courier New"'>scan-build</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ Perl wrapper, it passes the Linux/Cygwin version of the path, but to the VS built ‘</span><span style='font-family:"Courier New"'>clang.exe</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>So the data for the reports “is” being created by ‘</span><span style='font-family:"Courier New"'>clang</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’, but it is being placed at:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>D:\src\tests\ScanBuild\check</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>which is not the same place. The when ‘</span><span style='font-family:"Courier New"'>scan-build</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’ tries to collate the data and generate the report, the directory Perl looks in is empty. I can fix this, I just need to swot up my OS Perl knowledge and I should be able to fix it. I may need to do something similar in ‘</span><span style='font-family:"Courier New"'>ccc-analyzer</span><span style='font-family:"Book Antiqua","serif";color:#002060'>’. I will feedback any changes that may be useful to others once I have it figured out.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'>Thanks for your help, I would never have found this if you hadn’t given me good pointers to prove that I could generate the PList files.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> MartinO</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#002060'> </span><o:p></o:p></p></div><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><div><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span class=apple-converted-space><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span></span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Martin J. O'Riordan [<a href="mailto:martin.oriordan@movidius.com"><span style='color:purple'>mailto:martin.oriordan@movidius.com</span></a>]<span class=apple-converted-space> </span><br><b>Sent:</b><span class=apple-converted-space> </span>12 November 2016 20:36<br><b>To:</b><span class=apple-converted-space> </span>'<a href="mailto:ganna@apple.com"><span style='color:purple'>ganna@apple.com</span></a>' <<a href="mailto:ganna@apple.com"><span style='color:purple'>ganna@apple.com</span></a>><br><b>Cc:</b><span class=apple-converted-space> </span>'Aleksei Sidorin' <<a href="mailto:a.sidorin@samsung.com"><span style='color:purple'>a.sidorin@samsung.com</span></a>>; 'cfe-dev' <<a href="mailto:cfe-dev@lists.llvm.org"><span style='color:purple'>cfe-dev@lists.llvm.org</span></a>><br><b>Subject:</b><span class=apple-converted-space> </span>RE: [cfe-dev] Learning how to use and deploy 'scan-build'</span><o:p></o:p></p></div></div></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>Thanks Anna,</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>Actually there was a typo in my message and I actually had the identifier ‘</span><span style='font-family:"Courier New"'>zero</span><span style='font-family:"Book Antiqua","serif"'>’ not the constant ‘</span><span style='font-family:"Courier New"'>0</span><span style='font-family:"Book Antiqua","serif"'>’:</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>int main () {</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'> int zero = 0;</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'> return 5 / zero;</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>}</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>but I have changed this to just contain:</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>int foo () {</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'> int x = 0;</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'> return 5/x;</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>}</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>Compiling this as:</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>clang++ --analyze testScanBuild.cpp</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>does report the warning, and creates the file ‘</span><span style='font-family:"Courier New"'>testScanBuild.plist</span><span style='font-family:"Book Antiqua","serif"'>’ which on inspection appears to contain the expected diagnostic information, and compiling it as:</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>clang++ -c testScanBuild.cpp</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>does not produce a warning (no ‘</span><span style='font-family:"Courier New"'>-Wall</span><span style='font-family:"Book Antiqua","serif"'>’ option).</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>I just changed my Makefile to simply:</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>build: testScanBuild.o</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'> </span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>%o.%cpp:</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'> $(CXX) -c $<</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>and:</span><o:p></o:p></p></div><div style='margin-left:36.0pt'><p class=MsoNormal><span style='font-family:"Courier New"'>scan-build --use-cc clang --use-cxx clang++ -v -v -v -o check --keep-empty make build</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>I had not realised that the analyzers would not produce a report if the compiler already warned.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'>Thanks again,</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif"'> MartinO</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";color:#943634'> </span><o:p></o:p></p></div><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><div><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span class=apple-converted-space><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span></span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><a href="mailto:ganna@apple.com"><span style='color:purple'>ganna@apple.com</span></a><span class=apple-converted-space> </span>[<a href="mailto:ganna@apple.com"><span style='color:purple'>mailto:ganna@apple.com</span></a>]<span class=apple-converted-space> </span><br><b>Sent:</b><span class=apple-converted-space> </span>12 November 2016 19:54<br><b>To:</b><span class=apple-converted-space> </span><a href="mailto:Martin.ORiordan@Movidius.com"><span style='color:purple'>Martin.ORiordan@Movidius.com</span></a><br><b>Cc:</b><span class=apple-converted-space> </span>Aleksei Sidorin <<a href="mailto:a.sidorin@samsung.com"><span style='color:purple'>a.sidorin@samsung.com</span></a>>; cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org"><span style='color:purple'>cfe-dev@lists.llvm.org</span></a>><br><b>Subject:</b><span class=apple-converted-space> </span>Re: [cfe-dev] Learning how to use and deploy 'scan-build'</span><o:p></o:p></p></div></div></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal>Please, use the examples I provided in the previous email. The analyzer tries to avoid reporting the issues that can be found by the compiler.<o:p></o:p></p></div><div><div><p class=MsoNormal> <o:p></o:p></p></div><div><div><div><p class=MsoNormal style='background:white'><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Annas-MBP-3:compiler-rt anna$ clang --analyze ~/tmp/ex.c</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><b><span style='font-size:8.5pt;font-family:"Menlo","serif"'>/Users/anna/tmp/ex.c:6:11:<span class=apple-converted-space> </span><span style='color:#D53BD3'>warning:<span class=apple-converted-space> </span></span>Division by zero</span></b><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><span style='font-size:8.5pt;font-family:"Menlo","serif"'> return 5/x + 5/0;</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><b><span style='font-size:8.5pt;font-family:"Menlo","serif";color:#34BC26'> ~^~</span></b><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><span style='font-size:8.5pt;font-family:"Menlo","serif"'>1 warning generated.</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><span style='font-size:8.5pt;font-family:"Menlo","serif"'>Annas-MBP-3:compiler-rt anna$ clang -fsyntax-only ~/tmp/ex.c</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><b><span style='font-size:8.5pt;font-family:"Menlo","serif"'>/Users/anna/tmp/ex.c:6:17:<span class=apple-converted-space> </span><span style='color:#D53BD3'>warning:<span class=apple-converted-space> </span></span>division by zero is undefined [-Wdivision-by-zero]</span></b><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><span style='font-size:8.5pt;font-family:"Menlo","serif"'> return 5/x + 5/0;</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><b><span style='font-size:8.5pt;font-family:"Menlo","serif";color:#34BC26'> ^~</span></b><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='background:white'><span style='font-size:8.5pt;font-family:"Menlo","serif"'>1 warning generated.</span><o:p></o:p></p></div></div></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>