<div dir="ltr"><div><div><div>Hi again,<br><br></div>these information are still not enough to help you out. So, I only can guess what you have or trying to achieve... As I suggested earlier, try to compile your project with Clang as a first step. If you done that, scan-build won't be an issue... As far as I can see, you have a cross-compiler gcc and a native clang compiler. (Is this correct?) You might want to look at these pages: <a href="https://clang.llvm.org/docs/CrossCompilation.html">https://clang.llvm.org/docs/CrossCompilation.html</a> <a href="http://llvm.org/docs/HowToCrossCompileLLVM.html">http://llvm.org/docs/HowToCrossCompileLLVM.html</a><br><br></div>Regards,<br></div>Laszlo<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 23, 2017 at 2:51 PM, 逆水x轻风 <span dir="ltr"><<a href="mailto:526642675@qq.com" target="_blank">526642675@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you for answering my email. The cmd we use is "scan-build --use-analyzer=/home/clang/<wbr>bin/clang --use-cc=/home/gcc/arm-none-<wbr>eabi/bin/arm-none-eabi-gcc --analyzer-target=arm-linux-<wbr>gnueabi make -s MMU=2 products_isp=hi6250 -j"<br><br>The version of clang is 3.8.256229 and gcc is 4.7.1 and os is Ubuntu 12.04<br>The error log of clang is : <br>In file include from /usr/include/math.h/usr/<wbr>include/bits/matchcalls.h:110:<wbr>1 error expected identifier or "("<br>______________________________<wbr>__<br>However, /usr/include/math.h is not the head file we need, we found /usr/include/ is the default include <...> path of clang. Actually, we need /home/gcc/arm-none-eabi/<wbr>include/math.h , it's in the default include path of gcc(/home/gcc/arm-none-eabi/<wbr>include/).<br><br>So, how can we use the include path of gcc when run the scan-build cmd ?<br>---原始邮件---<br>发件人:"Artem Dergachev"<<a href="mailto:noqnoqneo@gmail.com" target="_blank">noqnoqneo@gmail.com</a><wbr>><br>发送时间:2017年2月20日 星期一 下午10:57<br>收件人:"Laszlo Nagy"<<a href="mailto:rizsotto.mailinglist@gmail.com" target="_blank">rizsotto.mailinglist@<wbr>gmail.com</a>>;"逆水x轻风"<<a href="mailto:526642675@qq.com" target="_blank">526642675@<wbr>qq.com</a>><br>抄送:"cfe-dev"<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.<wbr>llvm.org</a>><br>主题:Re: [cfe-dev] Problem when using scan-build<div class="HOEnZb"><div class="h5"><br>The scan-build tool should be <wbr>using the original compiler <wbr>for compiling<br>(transparently) and clang for <wbr>analysis (inevitably). It <wbr>means that both<br>compilers need to compile the <wbr>code independently (even <wbr>though the clang<br>instance that is used for <wbr>analysis doesn't produce any <wbr>binaries, all<br>earlier phases of compilation <wbr>need to occur), which means <wbr>they need to<br>find all includes. It also <wbr>means that if a certain <wbr>translation unit<br>cannot be compiled with clang <wbr>(with relevantly interposed <wbr>compilation<br>flags), it cannot be analyzed.<br>So i'd second the question <wbr>regarding which includes you'<wbr>re having<br>problems with.<br>On 2/20/17 1:04 PM, Laszlo <wbr>Nagy via cfe-dev wrote:<br>> This question is related <wbr>little to scan-build. scan-<wbr>build calls clang,<br>> so if you know how to <wbr>compile your code with clang <wbr>and use gcc<br>> specific header files, then <wbr>you got the answer... You <wbr>shall know,<br>> there are compiler specific <wbr>header files, which you won't <wbr>be able to<br>> interchange between <wbr>compilers. Please be more <wbr>specific with your<br>> question which header files <wbr>you wish to be used. And also,<wbr> in order to<br>> get help, you need to tell <wbr>more about your setup. (what <wbr>os? what<br>> version of gcc? which clang <wbr>version? how clang got <wbr>compiled? etc..)<br>><br>> On Mon, Feb 20, 2017 at 6:<wbr>19 PM, 逆水x轻风 via cfe-dev<br>> <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <<wbr>mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><wbr>> wrote:<br>><br>>     With --use-c=gcc and --<wbr>use-analyzer=clang when run "<wbr>scan-build" it<br>>     will use include<...> <wbr>of clang , but we need <wbr>include<...> of gcc.<br>>     How can I define the <wbr>default include path of gcc <wbr>when I run<br>>     "scan-build --use-c=gcc <wbr>--use-analyzer=clang make" ?<br>>     ________________________<wbr>_______________________<br>>     cfe-dev mailing list<br>>     <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <<wbr>mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br>>     <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/<wbr>cgi-bin/mailman/listinfo/cfe-<wbr>dev</a><br>>     <<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev%3E" target="_blank">http://lists.llvm.org/<wbr>cgi-bin/mailman/listinfo/cfe-<wbr>dev></a><br>><br>><br>><br>><br>> ____________________________<wbr>___________________<br>> cfe-dev mailing list<br>> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-<wbr>bin/mailman/listinfo/cfe-dev</a><br></div></div></blockquote></div><br></div>