<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 clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Sincerely,<br>Alexander Riccio<br>--<br>"Change the world or go home."<div><a href="http://about.me/ariccio" target="_blank">about.me/ariccio</a></div><div><a href="http://about.me/ariccio" target="_blank"><br></a></div><div>If left to my own devices, I will build more.</div><div>⁂<br></div></div></div></div></div></div></div>
</div></div>