<br><br><div class="gmail_quote">Le 28 mars 2012 17:55, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>></span> a écrit :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="http://llvm.org/PR9952" target="_blank">http://llvm.org/PR9952</a><br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Mar 27, 2012 at 11:54 PM, Jordan Rose <<a href="mailto:jediknil@belkadan.com">jediknil@belkadan.com</a>> wrote:<br>
> I thought we had a PR tracking this for the analyzer or for Sema, but I can't find it. I definitely remember discussion about adding this feature, which stopped around the problem of "what makes two expressions suspiciously equivalent", but just because it's a difficult problem doesn't mean we shouldn't be working towards this warning.<br>

><br>
><br>
> On Mar 27, 2012, at 22:24, Ted Kremenek wrote:<br>
><br>
>> Author: kremenek<br>
>> Date: Wed Mar 28 00:24:50 2012<br>
>> New Revision: 153568<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=153568&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=153568&view=rev</a><br>
>> Log:<br>
>> Fix suspicious comparison reported by PVS-Studio!<br>
>><br>
>> Modified:<br>
>>    cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp<br>
>><br>
>> Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=153568&r1=153567&r2=153568&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=153568&r1=153567&r2=153568&view=diff</a><br>

>> ==============================================================================<br>
>> --- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)<br>
>> +++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Wed Mar 28 00:24:50 2012<br>
>> @@ -925,7 +925,7 @@<br>
>>            SM.getExpansionColumnNumber(ContaineeRBeg)) &&<br>
>>           (ContainerEndLine != ContaineeEndLine ||<br>
>>            SM.getExpansionColumnNumber(ContainerREnd) >=<br>
>> -           SM.getExpansionColumnNumber(ContainerREnd)));<br>
>> +           SM.getExpansionColumnNumber(ContaineeREnd)));<br>
>> }<br>
>></div></div></blockquote><div> <br></div></div>Hum... Honestly, a one character difference between identifiers that are 13 characters long is rather unobvious. Took me 3 times reading the two lines to actually spot the difference.<br>
<br>I think it would have been much easier to spot this error (for a human) if the difference between the identifiers was more pronounced.<br><br>-- Matthieu<br><br>