<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hello,<br>
<br>
It looks like clang is thinking that he has to compile the file
because the default behaviour was not changed via cmdline options.
Could you try:<br>
<br>
clang --analyze <span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">-Xclang </span>-analyzer-checker=checker_name
test.c<br>
<br>
? --analyze will tell clang that he doesn't need to produce
binary, only to analyze the file.<br>
<br>
<br>
06.02.2018 04:24, Yingtong Liu via cfe-dev пишет:<br>
</div>
<blockquote type="cite"
cite="mid:CADPxJi8OSQs9nuWmM57hF_yCxsT3Ma=wCoxuAy5Nu2w1cBapRg@mail.gmail.com">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I am trying to use clang static checker from command line.
I knew there are two ways to do that. One is using scan-build
command, which works fine for me. But I need to use the
checker in another way, which is from the official website,
like:</div>
<div><br>
</div>
<div> clang -Xclang -analyze <span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">-Xclang </span>-analyzer-checker=checker_name
test.c</div>
<div><br>
</div>
<div>This reported me /usr/bin/ld: cannot find /tmp/xxx.o: File
format not recognized. It seems like the xxx.o file never
being generated using this command line. </div>
<div><br>
</div>
<div>When I added -cc1 option, using it like this way,</div>
<div><br>
</div>
<div> clang -cc1 -analyze -analyzer-checker=xxx
test.c<br>
</div>
<div><br>
</div>
<div>The error is gone, but I have to include all the default
compiler headers manually, which I don't wanna do.</div>
<div><br>
</div>
<div>My question is, what's the right way to pass the checker to
clang to get the bug report and the built file at the same
time?</div>
<div><br clear="all">
<div>
<div class="gmail_signature">
<div dir="ltr">
<div style="font-size:small"><span
style="font-size:12.8px">Thanks,</span></div>
<div style="font-size:small"><span
style="font-size:12.8px">Ying</span></div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
Best regards,
Aleksei Sidorin,
SRR, Samsung Electronics
</pre>
</body>
</html>