<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:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@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.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle20
        {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:#002060;mso-fareast-language:EN-US'>Thanks very much for your very helpful feedback, and I now have it mostly working.  However, I must still be doing something wrong as I am not seeing any analysis reports, and it would be great if someone could point out what I am doing wrong.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>I am using ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>clang</span><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>’ v3.9.0 built with Visual Studio 2013 on Windows, but running the test under Cygwin.  In the description below I use the terms ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'><<i>tools-cygpath</i>></span><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>’, ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'><<i>tools-WINPATH</i>></span><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>’, ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'><<i>test-cygpath</i>></span><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>’ and ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'><<i>test-WINPATH</i>></span><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>’ to indicate the paths to the tools and test source from both Cygwin’s and Windows’ perspectives.  The actual paths are too long to trouble you with, and not useful.  My version of Perl on Cygwin is v5.14.4.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>The following describes how I am invoking ‘</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:#002060;mso-fareast-language:EN-US'>’ and my observations of its execution - sorry for the long description, but I did not want to elide anything that may be useful:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// How I invoke '</span></b><b><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>scan-build</span></b><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>'::<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'><<i>tools-cygpath</i>>/bin/scan-build \<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'>        --use-cc        clang \<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'>        --use-c++       clang++ \<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'>        -enable-checker "core,security" \<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'>        -v -v -v \<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 check \<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'>        --html-title "Testing ScanBuild" \<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'>        make build<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// </span></b><b><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>'scan-build</span></b><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>' invokes '</span></b><b><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>c++-analyzer</span></b><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>' as follows (these are the parameters I pass to the compiler normally)::<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'><<i>tools-cygpath</i>>/bin/../libexec/c++-analyzer \<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'>    -v -c -Wall -fverbose-asm -UNDEBUG \<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'>    -O3 -std=c++14 testingScanBuild.cpp -o testingScanBuild.o<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// </span></b><b><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>'c++-analyzer</span></b><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>' invokes my '</span></b><b><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>clang++</span></b><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>' as follows (these are the normal options we expect)::<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>"<<i>tools-WINPATH</i>>\\bin\\clang++.exe" -cc1 -triple shave -S \<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'>    -disable-free -disable-llvm-verifier -discard-value-names \<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'>    -main-file-name testingScanBuild.cpp \<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'>    -mrelocation-model static -mthread-model posix \<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'>    -mdisable-fp-elim -masm-verbose -no-integrated-as -funroll-loops \<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'>    -mllvm -unroll-allow-partial \<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'>    -mno-zero-initialized-in-bss -fno-rtti \<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'>    -mllvm -enable-misched \<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'>    -mllvm -enable-aa-sched-mi \<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'>    -mllvm -misched-bottomup \<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'>    -mllvm -misched=ilpmax \<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'>    -v -dwarf-column-info -debugger-tuning=gdb \<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'>    -coverage-file "<<i>test-WINPATH</i>>\\ScanBuild\\testingScanBuild.o" \<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'>    -resource-dir "<<i>tools-WINPATH</i>>\\bin\\..\\lib\\clang\\3.9.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'>    -U NDEBUG \<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'>    -internal-externc-isystem "<<i>tools-WINPATH</i>>\\include\\c++" \<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'>    -internal-externc-isystem "<<i>tools-WINPATH</i>>\\include" \<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'>    -O3 -Wall -std=c++14 \<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'>    -fdeprecated-macro -fno-dwarf-directory-asm \<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'>    -fdebug-compilation-dir "<<i>test-WINPATH</i>>\\ScanBuild" \<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'>    -ferror-limit 19 -fmessage-length 0 -ffreestanding \<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'>    -fallow-half-arguments-and-returns -fobjc-runtime=gcc \<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'>    -fdiagnostics-show-option -vectorize-loops -vectorize-slp \<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 "D:\\tmp\\testingScanBuild-413704.s" \<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'>    -x c++ testingScanBuild.cpp<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// Then '</span></b><b><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>c++-analyzer</span></b><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>' reports this following which mirrors the usual<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// invocation, but also includes many Analysis options (indented)::<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>[LOCATION]: <<i>test-cygpath</i>>/ScanBuild<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'>#SHELL (cd '<<i>test-cygpath</i>>/ScanBuild' && '<<i>tools-cygpath</i>>/bin/clang' \<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'>    '-cc1' '-triple' 'shave' '-analyze' '-disable-free' \<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'>    '-disable-llvm-verifier' '-discard-value-names' \<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'>    '-main-file-name' 'testingScanBuild.cpp' \<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'>        '-analyzer-store=region' \<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'>        '-analyzer-opt-analyze-nested-blocks' \<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'>        '-analyzer-eagerly-assume' \<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'>        '-analyzer-checker=core' \<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'>        '-analyzer-checker=unix' \<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'>        '-analyzer-checker=deadcode' \<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'>        '-analyzer-checker=cplusplus' \<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'>        '-analyzer-checker=security.insecureAPI.UncheckedReturn' \<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'>        '-analyzer-checker=security.insecureAPI.getpw' \<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'>        '-analyzer-checker=security.insecureAPI.gets' \<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'>        '-analyzer-checker=security.insecureAPI.mktemp' \<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'>        '-analyzer-checker=security.insecureAPI.mkstemp' \<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'>        '-analyzer-checker=security.insecureAPI.vfork' \<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'>        '-analyzer-checker=nullability.NullPassedToNonnull' \<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'>        '-analyzer-checker=nullability.NullReturnedFromNonnull' \<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'>        '-analyzer-output' \<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'>        'plist' \<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'>    '-w' '-mrelocation-model' 'static' '-mthread-model' 'posix' \<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'>    '-mdisable-fp-elim' '-masm-verbose' '-no-integrated-as' '-funroll-loops' \<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'>    '-mllvm' '-unroll-allow-partial' \<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'>    '-mno-zero-initialized-in-bss' '-fno-rtti' \<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'>    '-mllvm' '-enable-misched' \<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'>    '-mllvm' '-enable-aa-sched-mi' \<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'>    '-mllvm' '-misched-bottomup' \<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'>    '-mllvm' '-misched=ilpmax' \<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'>    '-v' '-dwarf-column-info' '-debugger-tuning=gdb' \<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'>    '-resource-dir' '<<i>tools-WINPATH</i>>\bin\..\lib\clang\3.9.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'>    '-U' 'NDEBUG' \<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'>    '-internal-externc-isystem' '<<i>tools-WINPATH</i>>\include\c++' \<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'>    '-internal-externc-isystem' '<<i>tools-WINPATH</i>>\include' \<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'>    '-O3' '-std=c++14' \<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'>    '-fdeprecated-macro' '-fno-dwarf-directory-asm' \<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'>    '-fdebug-compilation-dir' '<<i>test-WINPATH</i>>\ScanBuild' \<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'>    '-ferror-limit' '19' '-fmessage-length' '0' '-ffreestanding' \<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'>    '-fallow-half-arguments-and-returns' '-fobjc-runtime=gcc' \<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'>    '-fdiagnostics-show-option' '-vectorize-loops' '-vectorize-slp' \<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'>        '-analyzer-display-progress' \<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'>        '-analyzer-checker' 'core,security' \<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'>        '-analyzer-opt-analyze-headers' \<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'>        '-analyzer-output=html' \<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' '<<i>test-cygpath</i>>/ScanBuild/check/2016-11-12-114955-13712-1' \<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'>    '-x' 'c++' 'testingScanBuild.cpp')<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// The analyser reports the following progress, I have elided references to<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// headers and other non-relevant files::<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>ANALYZE (Syntax): testingScanBuild.cpp verifyResult<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): testingScanBuild.cpp verifyResult<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): testingScanBuild.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 (Syntax): testingScanBuild.cpp generateInputData<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): testingScanBuild.cpp generateOutputData<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): testingScanBuild.cpp main<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'>// Finally it concludes with::<o:p></o:p></span></b></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-115552-7812-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.<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Book Antiqua",serif;color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>But in my test, I have deliberately seeded it with unreachable code that I would expect the dead-code checker to find:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;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'>bool flag = someTestCondition == true;<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'>if (flag) {<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'>  doSomethingInteresting();<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'>} else if (flag)        { // Same test as above<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'>  unreachableCode();      // Expecting an SA diagnostic here<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'>} else {<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'>  doNothing();<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:#002060;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>I’m sure that there is something really simple that I am missing, but I have no idea what it is.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#002060;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'> Anna Zaks [mailto:ganna@apple.com] <br><b>Sent:</b> 11 November 2016 23:39<br><b>To:</b> Aleksei Sidorin <a.sidorin@samsung.com><br><b>Cc:</b> Martin J. O'Riordan <martin.oriordan@movidius.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><o:p> </o:p></p><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>On Nov 11, 2016, at 6:26 AM, Aleksei Sidorin via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal style='background:white'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'>Hello Martin!<br><br>11.11.2016 16:48, Martin J. O'Riordan via cfe-dev пишет:<o:p></o:p></span></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt;font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>I am working on adding ‘scan-build’ to the set of tools we include with our release of ‘clang’, and trying to determine the minimal set of components needed to be able to successfully use ‘scan-build’.  The documentation for this is fairly thin, so there are many things I am having to learn.</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>Currently we just provide the compiler itself, along with the headers and libraries for our SHAVE target.  I would like to add a lot of the additional tools and utilities that CLang/LLVM provide with future versions, ‘scan-build’ is one of these, and ‘clang-tidy’, etc., but not a complete set.</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>In addition to the ‘scan-build’ Perl script itself, I also need the ‘ccc-analyzer’ and ‘c++-analyzer’ Perl scripts, and this appears to run without error; but I would like to know are their other components that I need to ensure that it is fully functional?</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div></blockquote><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white'>As I remember, Perl scan-build doesn't have any additional dependencies.</span><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br style='font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>I would like to know what is the “core set” of analysers?  I listed the full set of analysers in ‘clang’ v3.9.0 and some of these names are prefixed with ‘core.’ so I presume these are the ones that comprise the core set? <span class=apple-converted-space> </span></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div></blockquote><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white'>The "core" set is responsible for basic modelling of some functions in path-sensitive mode, they are not the analyzer core itself. Shortly, analyzer has two kinds of checkers - AST/CFG based (fast) and path-sensitive (slow but more powerful). If you need any path-sensitive checkers, you should also enable "core" checkers for more precise modelling.</span><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br><br><span style='background:white'>// TODO: enable "core" automatically in such cases?</span></span><o:p></o:p></p></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>I would recommend to start with the default set of checkers and disable the ones you do not find useful for your codebase (if any).<o:p></o:p></p></div><div><p class=MsoNormal><br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt;font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>When enabling others I presume I have to add a comma-separated list to the ‘-enable-checker’ option, for example ‘debug.Stats,unix.Malloc’.  The names in the list of checks are formed with separating dot characters, does selecting something like ‘security’ enable all the checkers in the ‘security.*’ group, or do I have to enable them one at a time?</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div></blockquote><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white'>To enable a full package, you should just point it. Example: "-enable-checker core,security"</span><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br style='font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>Sorry if this is all answered in some part of the documentation I haven’t  found, and please point me at it.</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div></blockquote><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white'>You can find some additional information on<span class=apple-converted-space> </span></span><a href="http://clang-analyzer.llvm.org/"><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#954F72;background:white'>http://clang-analyzer.llvm.org</span></a><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br style='font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>Thanks,</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'>           <span class=apple-converted-space> </span>MartinO</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-family:"Calibri",sans-serif'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p></o:p></span></p></div><p class=MsoNormal style='background:white'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br><br><br><o:p></o:p></span></p><pre style='background:white'>_______________________________________________<o:p></o:p></pre><pre style='background:white'>cfe-dev mailing list<o:p></o:p></pre><pre style='background:white'><a href="mailto:cfe-dev@lists.llvm.org"><span style='color:#954F72'>cfe-dev@lists.llvm.org</span></a><o:p></o:p></pre><pre style='background:white'><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"><span style='color:#954F72'>http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</span></a><o:p></o:p></pre></blockquote><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br style='font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><o:p> </o:p></span></p><pre style='background:white;font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><span style='font-size:9.0pt'>-- <o:p></o:p></span></pre><pre style='background:white'><span style='font-size:9.0pt'>Best regards,<o:p></o:p></span></pre><pre style='background:white'><span style='font-size:9.0pt'>Aleksei Sidorin<o:p></o:p></span></pre><pre style='background:white'><span style='font-size:9.0pt'>Software Engineer, <o:p></o:p></span></pre><pre style='background:white'><span style='font-size:9.0pt'>IMSWL-IMCG, SRR, Samsung Electronics<o:p></o:p></span></pre><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;background:white'>_______________________________________________</span><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br><span style='background:white'>cfe-dev mailing list</span><br></span><a href="mailto:cfe-dev@lists.llvm.org"><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#954F72;background:white'>cfe-dev@lists.llvm.org</span></a><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif'><br></span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"><span style='font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#954F72;background:white'>http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</span></a><o:p></o:p></p></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>