<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 18, 2014 at 11:05 PM, Yury Gribov <span dir="ltr"><<a href="mailto:y.gribov@samsung.com" target="_blank">y.gribov@samsung.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 12/19/2014 01:14 AM, Nick Lewycky wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 12/16/2014 02:43 AM, Yury Gribov wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 12/15/2014 10:24 PM, Ismail Pazarbasi wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
s.d = 42.0;<br>
if (s.l > 100) // fire here<br>
</blockquote>
<br>
Note that code like this is frequently used to convert integers to<br>
floats so you'll get tons of false positives.<br>
</blockquote>
<br>
True positives. The fix is to use memcpy instead.<br>
</blockquote>
<br></span>
Hm, I thought C aliasing rules explicitly allow changing types through unions.</blockquote><div><br class="">See my previous email; the kindest thing I can say about how C treats aliasing through unions is that it is confused.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Anyway, the pattern is so widespread that IMHO most maintainers will find such errors useless.</blockquote><div><br></div><div>Well, given that this is the bug that the sanitizer is built to detect, such maintainers should not turn it on.</div></div></div></div>