<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 4, 2014 at 3:54 AM, Lubos Lunak <span dir="ltr"><<a href="mailto:l.lunak@centrum.cz" target="_blank">l.lunak@centrum.cz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
 This is a reduced version of the original patch for PR12463 that handles only<br>
string comparisons (I don't care about arrays enough to deal with the details<br>
and there the problem is unlikely to happen anyway, but the problem is more<br>
likely with strings if e.g. refactoring).</blockquote><div><br></div><div>It seems a bit strange to treat arrays and string literals differently (since string literals are basically just a weird way to write and name a unique array). From your comments on the PR, I guess you're concerned about false positives on this kind of case:</div>
<div><br></div><div>  #define ARRAY_COPY(x, y) do { if ((x) == (y)) { /* same array */ } else { memcpy(&(x)[0], &(y)[0], min(sizeof(x), sizeof(y))); } } while (0)</div><div><br></div><div>... where it's intentional for x and y to be arrays. But for that code, it'd be equally fine for y to be a string literal.</div>
<div><br></div><div>Do you have any numbers for true positives / false positives with this diagnostic change?</div></div></div></div>