<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=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
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.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello Clang experts,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am currently working on upgrading a tool for static code analysis based on libclang. It uses a RecursiveASTVisitor to traverse the syntax tree and extract some information relevant to us. To support a bunch of new features,
 I had to upgrade Clang from Version 3.1 as used before to 3.4.2 (I am stuck on Visual Studio 2010, so no up-to-date Clang, unfortunately). To verify that the new Clang behaves as expected, I have inherited a number of testcases from another project, based
 the clang test suite. Among other things, these testcases check whether extra parentheses are detected (example: 'if ((x == 2)) {') or whether a static analysis shows that an array access out of bounds is found in the code (example: 'int array[2]; array[5]
 = 7;'). However, my tool does not output the respective warnings. If I run clang.exe on the respective source files, I get all the expected warnings.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">After brooding on this problem for a while, I realized that detecting array access out of bounds is actually a semantic analysis, not a syntactic one. However, when using a RecursiveASTVisitor, I am only doing a syntactic
 analysis. Thus, I can actually expect *not* to see any of these warnings. Are these assumptions correct, or does Clang always perform a semantic analysis and it is in fact my code that eats the warning messages?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you in advance for any input!<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:DE"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">Damian Philipp<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">-----------------------------------------------------<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">Software Development Engineer<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">PES<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span style="mso-fareast-language:DE">Vector Informatik GmbH</span></b><span style="mso-fareast-language:DE"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Ingersheimer Str. 24<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-fareast-language:DE">70499 Stuttgart<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Deutschland / Germany<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Tel.: +49 711 80670-3656<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="mso-fareast-language:DE">Fax: +49 711 80670-399<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">mailto: </span>
<span style="mso-fareast-language:DE"><a href="mailto:Damian.Philipp@vector.com"><span lang="EN-US" style="color:blue">Damian.Philipp@vector.com</span></a></span><span lang="EN-US" style="mso-fareast-language:DE"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE">Internet:
</span><span style="mso-fareast-language:DE"><a href="http://www.vector.com/"><span lang="EN-US" style="color:blue">www.vector.com</span></a></span><span lang="EN-US" style="mso-fareast-language:DE"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:DE"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;mso-fareast-language:DE">Sitz der Gesellschaft / Head Office: Stuttgart<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;mso-fareast-language:DE">Handelsregister / Commercial Register:
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;mso-fareast-language:DE">Amtsgericht Stuttgart, HRB 17317
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;mso-fareast-language:DE">Geschaeftsfuehrer / Managing Directors:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;mso-fareast-language:DE">Dr. Thomas Beck, Thomas Riegraf<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="mso-fareast-language:DE">-----------------------------------------------------</span><span style="mso-fareast-language:DE"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>