<div dir="ltr">My guess would be that --analyze invokes the static analyzer and so the whole linking step is skipped.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 5:15 AM, <Alexander G. Riccio> via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</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 try to build a simple C program (attached), <font face="monospace, monospace">clang-cl</font> warns about some - unrelated to this question - linking issue:<div><br></div><div><div><font face="monospace, monospace">C:\Users\Alexander Riccio\Documents\basically_flawed_c_program>clang-cl basically_flawed_c_program.c</font></div><div><font face="monospace, monospace">basically_flawed_c_program-1f4f44.obj : error LNK2019: unresolved external symbol malloc referenced in function main</font></div><div><font face="monospace, monospace">basically_flawed_c_program-1f4f44.obj : error LNK2019: unresolved external symbol free referenced in function main</font></div><div><font face="monospace, monospace">LINK : error LNK2001: unresolved external symbol mainCRTStartup</font></div><div><font face="monospace, monospace">C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\libcmt.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'</font></div><div><font face="monospace, monospace">basically_flawed_c_program.exe : fatal error LNK1120: 3 unresolved externals</font></div><div><font face="monospace, monospace">clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see invocation)</font></div><div><br></div></div><div>...but when I pass <font face="monospace, monospace">--analyze</font> to <font face="monospace, monospace">clang-cl</font>, it shuts up entirely:</div><div><br></div><div><div><font face="monospace, monospace">C:\Users\Alexander Riccio\Documents\basically_flawed_c_program>clang-cl --analyze basically_flawed_c_program.c</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">C:\Users\Alexander Riccio\Documents\basically_flawed_c_program></font></div></div><div><br></div><div><br></div><div>What's going on here??</div><div><br></div><div>I'm more interested in why the <font face="monospace, monospace">--analyze</font> flag shuts <font face="monospace, monospace">clang-cl</font> up, than I am the strange linker error; but bonus points if you know what's going on there too.</div><div><br></div><div>I'm also attaching the verbose invocations of the two commands.</div><div><br></div><br clear="all"><div><div><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>
</div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>