<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Dec 9, 2011, at 6:06 AM, Peter Collingbourne wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Not yet, but I can imagine the sorts of false positives that will<br>be encountered (for example, allocations of sizeof(x) cast to y*,<br>where sizeof(x) is guaranteed by the standard to be at least as large<br>as sizeof(y), such as y being an unsigned variant of x, or x and y<br>being structs and y's field list being a prefix of x's). I don't<br>think we have a general mechanism for identifying these sorts of<br>false positives at the moment, do we?<br></span></blockquote><div><br></div><div>I don't think there is a general mechanism, and this really seems specific to this checker anyway. I'd expect to gradually see the evolution of helper function in the checker that encodes these heuristics.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br>(Incidentally, possible false negatives may involve use of size_t<br>or other platform-dependent typedefs... not sure what to do about<br>these, other than perhaps testing that the same typedef is used in<br>both cases).</span></blockquote><br></div><div>What about comparing the original, desugared type?</div><br></body></html>