<div dir="ltr">Did the warning find any legitimate bugs?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 5:09 PM, Oliver Chang <span dir="ltr"><<a href="mailto:ochang@google.com" target="_blank">ochang@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here are some general results after some quick testing (some of which is stolen from thakis's testing on chromium). Unfortunately some of these warnings were difficult to triage and requires a significant amount of time (which I think makes a point for this warning).<br>
<br>
Discounting duplicates in the same file, both Firefox and Chromium give around 8-10 warnings.<br>
<br>
Some patterns observed:<br>
<br>
- Most seem to just be based on size assumptions between types, e.g. 2 * sizeof(uint16_t) == sizeof(uint32_t).<br>
<br>
Firefox had about 2 instances where 2 different classes were expected to have the same size (e.g. when 1 is a wrapper around another).<br>
<br>
- In Chromium there are some issues with structs and unions that solely contained members of a single type.<br>
<br>
e.g.<br>
struct M {<br>
<br>
  int A[4];<br>
<br>
};<br>
<br>
M a;<br>
memset(&a, 0, sizeof(int) * 4);<br>
<br>
thakis@ suggested decaying the struct type to the member type in this case for the comparison.<br>
<br>
- Firefox also had about 2 warnings related to multidimensional arrays, e.g.<br>
<br>
typedef int Foo[10];<br>
Foo m;<br>
memset(&m, 0, sizeof(Foo));<br>
<br>
Perhaps we can just compare the type 'Foo' in this case before trying to break it down further in this case.<br>
<br>
- There are some other warnings such as differences complex_t vs float[2], w_char vs short.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="http://reviews.llvm.org/D8881" target="_blank">http://reviews.llvm.org/D8881</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>