<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I want to thank you for replying my question.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Actually I want to use the taint checker or modify it. <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
clang -cc1 -analyze -analyzer-checker=alpha.security.taint.TaintPropagation test.c</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
But it produced the same error as I mentioned in my last question.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Please tell me the procedure to use a particular checker. I was following the description as given in <a href="http://clang-developers.42468.n3.nabble.com/Purpose-of-GenericTaintChecker-td4051900.html" id="LPNoLP565601">http://clang-developers.42468.n3.nabble.com/Purpose-of-GenericTaintChecker-td4051900.html</a>
and <a href="http://clang-analyzer.llvm.org/checker_dev_manual.html" id="LPNoLP621567">
http://clang-analyzer.llvm.org/checker_dev_manual.html</a>.</div>
<br>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have tested the command "scan-build clang test.c" and it is working correctly. But I am not really interested to create the a.out and more interested to do the static analysis and get some kind of report.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<br>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Artem Dergachev <noqnoqneo@gmail.com><br>
<b>Sent:</b> Tuesday, 5 March 2019 1:42 AM<br>
<b>To:</b> Arnab Kumar Biswas; cfe-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [cfe-dev] Help required to use clang analyzer</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi,<br>
<br>
Using -cc1 disables the clang Driver. The Driver is responsible for gcc <br>
compatibility, which, apart from being able to translate gcc flags to <br>
clang flags, adds support for finding system headers in places where gcc <br>
usually looks for them. There are other drivers, such as clang-cl which <br>
turns clang into a drop-in replacement for the Visual Studio's cl.exe.<br>
<br>
Running without the driver is not recommended for everyday use, only for <br>
development of clang itself.<br>
<br>
If you want to run the Static Analyzer on a single file, you can do<br>
<br>
clang --analyze test.c<br>
<br>
But even better, you should use the scan-build tool to analyze the <br>
entire project, for example:<br>
<br>
scan-build clang test.c<br>
<br>
or<br>
<br>
scan-build gcc test.c<br>
<br>
or<br>
<br>
scan-build make -j4<br>
<br>
etc. See <a href="https://clang-analyzer.llvm.org/scan-build.html">https://clang-analyzer.llvm.org/scan-build.html</a> for more details.<br>
<br>
<br>
On 3/3/19 10:41 PM, Arnab Kumar Biswas via cfe-dev wrote:<br>
> Hi,<br>
> I am trying to use clang analyzer using the below command.<br>
><br>
> clang -cc1 -analyze -analyzer-checker=alpha.core test.c<br>
><br>
> I am getting the following error.<br>
><br>
> test.c:1:10: fatal error: 'sys/stat.h' file not found<br>
> #include <sys/stat.h><br>
> ^~~~~~~~~~~~<br>
> 1 error generated.<br>
><br>
> If I use the command,<br>
> clang test.c<br>
> there is no error.<br>
><br>
> Please help me to solve the error.<br>
><br>
> Arnab<br>
><br>
><br>
> ------------------------------------------------------------------------<br>
><br>
> Important: This email is confidential and may be privileged. If you <br>
> are not the intended recipient, please delete it and notify us <br>
> immediately; you should not copy or use it for any purpose, nor <br>
> disclose its contents to any other person. Thank you.<br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> cfe-dev@lists.llvm.org<br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br>
</div>
</span></font></div>
<br>
<hr>
<font face="Arial" color="Black" size="1"><br>
Important: This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Thank you.<br>
</font>
</body>
</html>