<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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 70.85pt 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="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Thanks for your comments.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">I was told that it was preferable to update the CFG. The reason is that all analyses built on top on the CFG will benefit:
 -Wuninitialized, static analyzer, warnings, etc. I wonder if Anna or Ted could provide their opinions about this patch?<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">//Anders<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Richard Trieu [mailto:rtrieu@google.com]
<br>
<b>Sent:</b> den 26 oktober 2013 01:43<br>
<b>To:</b> Jordan Rose<br>
<b>Cc:</b> Anders Rönnholm; cfe-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [PATCH] check for Incorrect logic in operator<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal">A few high level comments.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">"-fblocks -Wunreachable-code" is there any reason your test cases have these flags?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">"if (!x == 10) {}" there is an existing warning for this called -Wlogical-not-parentheses.  The check should be folded into there.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">"if ((x < y) == 10) {}" ditto this and -Wtautological-compare-out-of-range<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">"logical disjunction always evaluates to true"  I wouldn't expect all programmers to understand what a logical disjunction is.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If you check out -Wlogical-not-parentheses and -Wtautological-compare-out-of-range, they are in lib/Sema/SemaChecking.cpp.  Why did you use a CFG approach instead?<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Oct 25, 2013 at 10:18 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Richard Trieu has worked on a number of similar warnings. Maybe he can take a look?<br>
<br>
Jordan<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
On Oct 25, 2013, at 8:18, Anders Rönnholm <<a href="mailto:Anders.Ronnholm@evidente.se">Anders.Ronnholm@evidente.se</a>> wrote:<br>
<br>
> Hi,<br>
> Resending the patch I sent last week. Anyone want to have a look at it?<br>
><br>
> //Anders<br>
><br>
> -----Original Message-----<br>
> From: Anders Rönnholm<br>
> Sent: den 18 oktober 2013 16:05<br>
> To: <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> Subject: [PATCH] check for Incorrect logic in operator<br>
><br>
> Hi,<br>
><br>
> I have a new patch I like to get reviewed. It checks for incorrect logics in relational,equal and logic operators in cfgbuilder when trying to evaluate bool. A warning is emitted in Sema when an error occurs.<br>
><br>
> eg.<br>
> if (x != 2 || x != 3) { } always true<br>
> if ((x < y) <= 10) {}  always true<br>
><br>
> Thanks,<br>
> Anders<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">> <incorrectoperatorlogic.diff>_______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>