<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Great to hear that you found a solution!</div><div class=""><br class=""></div>Feel free to submit a patch; it might help others with the same setup:<div class=""><div class=""><a href="http://llvm.org/docs/Phabricator.html" class="">http://llvm.org/docs/Phabricator.html</a></div><div class=""><a href="http://llvm.org/docs/DeveloperPolicy.html" class="">http://llvm.org/docs/DeveloperPolicy.html</a></div><div class=""><br class=""></div><div class="">Anna.<br class=""><div><blockquote type="cite" class=""><div class="">On Nov 13, 2016, at 2:55 AM, Martin J. O'Riordan <<a href="mailto:Martin.ORiordan@movidius.com" class="">Martin.ORiordan@movidius.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">Following up on this, I have made a change to my local copy of ‘</span><span style="font-family: 'Courier New';" class="">ccc-analyzer</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ that compensates for the Windows vs Cygwin path differences.  In the subroutine ‘</span><span style="font-family: 'Courier New';" class="">sub Analyze</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ I have changed the lines:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    # Create arguments for doing static analysis.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    if (defined $ResultFile) {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">      push @Args, '-o', $ResultFile;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    elsif (defined $HtmlDir) {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">      push @Args, '-o', $HtmlDir;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">to:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    # Create arguments for doing static analysis.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    if (defined $ResultFile) {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">      push @Args, '-o', $ResultFile;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    elsif (defined $HtmlDir) {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">+     # Convert the output path to the Windows form on Cygwin<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">+     if ($^O =~/cygwin/) {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">+       my $winHtmlDir = `cygpath -m $HtmlDir`;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">+       $winHtmlDir =~ tr/\n\r//d;  # Strip newlines<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">+       push @Args, '-o', $winHtmlDir;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">+     } else {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">        push @Args, '-o', $HtmlDir;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">+     }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">I have used ‘</span><span style="font-family: 'Courier New';" class="">tr</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ rather than ‘</span><span style="font-family: 'Courier New';" class="">chomp</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ because I have found that ‘</span><span style="font-family: 'Courier New';" class="">chomp</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ does not always remove CRs and is not as robust as using this ‘</span><span style="font-family: 'Courier New';" class="">tr</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ pattern.  Also, I use the ‘</span><span style="font-family: 'Courier New';" class="">-m</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ option to ‘</span><span style="font-family: 'Courier New';" class="">cygpath</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ rather than ‘</span><span style="font-family: 'Courier New';" class="">-w</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ because it uses the ‘</span><span style="font-family: 'Courier New';" class="">/</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ character for directory path separators rather than ‘</span><span style="font-family: 'Courier New';" class="">\</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’.  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';" class="">/</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ character (WIN32’s file open functions accept either).<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">All the best and thanks to each of you for your advice and help,<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">            MartinO<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-color: rgb(225, 225, 225); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>Martin J. O'Riordan [<a href="mailto:martin.oriordan@movidius.com" style="color: purple; text-decoration: underline;" class="">mailto:martin.oriordan@movidius.com</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>12 November 2016 21:48<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>'<a href="mailto:ganna@apple.com" style="color: purple; text-decoration: underline;" class="">ganna@apple.com</a>' <<a href="mailto:ganna@apple.com" style="color: purple; text-decoration: underline;" class="">ganna@apple.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>'Aleksei Sidorin' <<a href="mailto:a.sidorin@samsung.com" style="color: purple; text-decoration: underline;" class="">a.sidorin@samsung.com</a>>; 'cfe-dev' <<a href="mailto:cfe-dev@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">cfe-dev@lists.llvm.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>RE: [cfe-dev] Learning how to use and deploy 'scan-build'<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">Hi again.  I have solved the problem that I was having but it is obscure so I will explain here.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">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).<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">In summary the issue is the path that is passed using ‘</span><span style="font-family: 'Courier New';" class="">-o</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ to the Visual Studio built ‘</span><span style="font-family: 'Courier New';" class="">clang.exe</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ which only understands Windows paths, but at line #1490 in ‘</span><span style="font-family: 'Courier New';" class="">scan-build</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ the path is constructed using:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">$Options{OutputDir} = abs_path($OutDir);<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">In my case the path for ‘</span><span style="font-family: 'Courier New';" class="">-o check</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ becomes:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">/src/tests/ScanBuild/check<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">But in my Cygwin setup, ‘</span><span style="font-family: 'Courier New';" class="">/src/</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ is actually a ‘</span><span style="font-family: 'Courier New';" class="">mount</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ of the directory ‘</span><span style="font-family: 'Courier New';" class="">S:\Projects\</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ - 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';" class="">bash</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ shell on Windows and Linux.  If I was passing the path to ‘</span><span style="font-family: 'Courier New';" class="">clang.exe</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ from a Makefile, I would typically use ‘</span><span style="font-family: 'Courier New';" class="">cygpath -m</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ to get the Windows path, but because this is happening in the generic ‘</span><span style="font-family: 'Courier New';" class="">scan-build</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ Perl wrapper, it passes the Linux/Cygwin version of the path, but to the VS built ‘</span><span style="font-family: 'Courier New';" class="">clang.exe</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">So the data for the reports “is” being created by ‘</span><span style="font-family: 'Courier New';" class="">clang</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’, but it is being placed at:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">D:\src\tests\ScanBuild\check<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">which is not the same place.  The when ‘</span><span style="font-family: 'Courier New';" class="">scan-build</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’ 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';" class="">ccc-analyzer</span><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">’.  I will feedback any changes that may be useful to others once I have it figured out.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">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.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class="">            MartinO<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(0, 32, 96);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-color: rgb(225, 225, 225); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>Martin J. O'Riordan [<a href="mailto:martin.oriordan@movidius.com" style="color: purple; text-decoration: underline;" class="">mailto:martin.oriordan@movidius.com</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>12 November 2016 20:36<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>'<a href="mailto:ganna@apple.com" style="color: purple; text-decoration: underline;" class="">ganna@apple.com</a>' <<a href="mailto:ganna@apple.com" style="color: purple; text-decoration: underline;" class="">ganna@apple.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>'Aleksei Sidorin' <<a href="mailto:a.sidorin@samsung.com" style="color: purple; text-decoration: underline;" class="">a.sidorin@samsung.com</a>>; 'cfe-dev' <<a href="mailto:cfe-dev@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">cfe-dev@lists.llvm.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>RE: [cfe-dev] Learning how to use and deploy 'scan-build'<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">Thanks Anna,<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">Actually there was a typo in my message and I actually had the identifier ‘</span><span style="font-family: 'Courier New';" class="">zero</span><span style="font-family: 'Book Antiqua', serif;" class="">’ not the constant ‘</span><span style="font-family: 'Courier New';" class="">0</span><span style="font-family: 'Book Antiqua', serif;" class="">’:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">int main () {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">  int zero = 0;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">  return 5 / zero;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">}<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">but I have changed this to just contain:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">int foo () {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">  int x = 0;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">  return 5/x;<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">}<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">Compiling this as:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">clang++ --analyze testScanBuild.cpp<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">does report the warning, and creates the file ‘</span><span style="font-family: 'Courier New';" class="">testScanBuild.plist</span><span style="font-family: 'Book Antiqua', serif;" class="">’ which on inspection appears to contain the expected diagnostic information, and compiling it as:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">clang++ -c testScanBuild.cpp<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">does not produce a warning  (no ‘</span><span style="font-family: 'Courier New';" class="">-Wall</span><span style="font-family: 'Book Antiqua', serif;" class="">’ option).<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">I just changed my Makefile to simply:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">build:  testScanBuild.o<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">%o.%cpp:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">    $(CXX) -c $<</span><span style="font-family: 'Book Antiqua', serif;" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">and:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Courier New';" class="">scan-build --use-cc clang --use-cxx clang++ -v -v -v -o check --keep-empty make build<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">I had not realised that the analyzers would not produce a report if the compiler already warned.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">Thanks again,<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif;" class="">            MartinO<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-family: 'Book Antiqua', serif; color: rgb(148, 54, 52);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-color: rgb(225, 225, 225); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span><a href="mailto:ganna@apple.com" style="color: purple; text-decoration: underline;" class="">ganna@apple.com</a><span class="Apple-converted-space"> </span>[<a href="mailto:ganna@apple.com" style="color: purple; text-decoration: underline;" class="">mailto:ganna@apple.com</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>12 November 2016 19:54<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:Martin.ORiordan@Movidius.com" style="color: purple; text-decoration: underline;" class="">Martin.ORiordan@Movidius.com</a><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Aleksei Sidorin <<a href="mailto:a.sidorin@samsung.com" style="color: purple; text-decoration: underline;" class="">a.sidorin@samsung.com</a>>; cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">cfe-dev@lists.llvm.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [cfe-dev] Learning how to use and deploy 'scan-build'<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">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 class=""></o:p></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">Annas-MBP-3:compiler-rt anna$ clang --analyze ~/tmp/ex.c<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><b class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">/Users/anna/tmp/ex.c:6:11:<span class="Apple-converted-space"> </span><span style="color: rgb(213, 59, 211);" class="">warning:<span class="Apple-converted-space"> </span></span>Division by zero</span></b><span style="font-size: 8.5pt; font-family: Menlo;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">  return 5/x + 5/0;<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><b class=""><span style="font-size: 8.5pt; font-family: Menlo; color: rgb(52, 188, 38);" class="">         ~^~</span></b><span style="font-size: 8.5pt; font-family: Menlo; color: rgb(52, 188, 38);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">1 warning generated.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">Annas-MBP-3:compiler-rt anna$ clang -fsyntax-only ~/tmp/ex.c<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><b class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">/Users/anna/tmp/ex.c:6:17:<span class="Apple-converted-space"> </span><span style="color: rgb(213, 59, 211);" class="">warning:<span class="Apple-converted-space"> </span></span>division by zero is undefined [-Wdivision-by-zero]</span></b><span style="font-size: 8.5pt; font-family: Menlo;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">  return 5/x + 5/0;<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><b class=""><span style="font-size: 8.5pt; font-family: Menlo; color: rgb(52, 188, 38);" class="">                ^~</span></b><span style="font-size: 8.5pt; font-family: Menlo; color: rgb(52, 188, 38);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; background-color: white;" class=""><span style="font-size: 8.5pt; font-family: Menlo;" class="">1 warning generated.</span></div></div></div></div></div></div></blockquote></div><br class=""></div></div></body></html>