<div dir="ltr">Is it because <a href="http://clang-analyzer.llvm.org/available_checks.html#unix_checkers">the checker is <i><b><u>unix</u></b></i>.malloc</a>? If so, that's actually quite terrible... why only check it on unix??</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8000001907349px">Sincerely,</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Alexander Riccio</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">--</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">"Change the world or go home."</span><div style="font-size:12.8000001907349px"><a href="http://about.me/ariccio" target="_blank">about.me/ariccio</a></div><div style="font-size:12.8000001907349px"><a href="http://about.me/ariccio" target="_blank"><br></a></div><div style="font-size:12.8000001907349px">If left to my own devices, I will build more.</div><div style="font-size:12.8000001907349px">⁂</div></div></div></div></div></div>
<br><div class="gmail_quote">On Sat, Jan 2, 2016 at 3:57 PM, <Alexander G. Riccio> <span dir="ltr"><<a href="mailto:test35965@gmail.com" target="_blank">test35965@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">When I build the attached C program in windows, using Clang built from a very recent tree version (trunk 256686), Clang fails to detect the trivial double free, as evidenced in the resulting plist file (attached).<div><br></div><div>What's going on here? I have a gut feeling that it has something to do with Clang's ignorance of SAL, which allows MSVC to detect the condition generically:</div><div><br></div><div><pre style="font-family:Consolas;color:gainsboro;background:rgb(30,30,30)"><span style="color:rgb(86,156,214)">void</span> <span style="color:rgb(86,156,214)">__cdecl</span> <span style="color:rgb(200,200,200)">free</span><span style="color:rgb(180,180,180)">(</span>
    <span style="color:rgb(189,99,197)">_Pre_maybenull_</span> <span style="color:rgb(189,99,197)">_Post_invalid_</span> <span style="color:rgb(86,156,214)">void</span><span style="color:rgb(180,180,180)">*</span> _Block
    <span style="color:rgb(180,180,180)">);</span>
</pre></div><div>(from C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt/corecrt_malloc.h)</div><div><br></div><div>I'm also attaching the verbose compilation output.</div><div><div><div><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px"><br></span></div><div dir="ltr"><span style="font-size:12.8px">Sincerely,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Alexander Riccio</span><br style="font-size:12.8px"><span style="font-size:12.8px">--</span><br style="font-size:12.8px"><span style="font-size:12.8px">"Change the world or go home."</span><div style="font-size:12.8px"><a href="http://about.me/ariccio" target="_blank">about.me/ariccio</a></div><div style="font-size:12.8px"><a href="http://about.me/ariccio" target="_blank"><br></a></div><div style="font-size:12.8px">If left to my own devices, I will build more.</div><div style="font-size:12.8px">⁂</div></div></div></div></div></div>
</div></div>
</blockquote></div><br></div>