Thank you for answering my email. The cmd we use is "scan-build --use-analyzer=/home/clang/bin/clang --use-cc=/home/gcc/arm-none-eabi/bin/arm-none-eabi-gcc --analyzer-target=arm-linux-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/include/bits/matchcalls.h:110:1 error expected identifier or "("<br/>________________________________<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/include/math.h , it's in the default include path of gcc(/home/gcc/arm-none-eabi/include/).<br/><br/>So, how can we use the include path of gcc when run the scan-build cmd ?<br/>---原始邮件---<br/>发件人:"Artem Dergachev"<noqnoqneo@gmail.com><br/>发送时间:2017年2月20日 星期一 下午10:57<br/>收件人:"Laszlo Nagy"<rizsotto.mailinglist@gmail.com>;"逆水x轻风"<526642675@qq.com><br/>抄送:"cfe-dev"<cfe-dev@lists.llvm.org><br/>主题:Re: [cfe-dev] Problem when using scan-build<br/>The scan-build tool should be using the original compiler for compiling<br/>(transparently) and clang for analysis (inevitably). It means that both<br/>compilers need to compile the code independently (even though the clang<br/>instance that is used for analysis doesn't produce any binaries, all<br/>earlier phases of compilation need to occur), which means they need to<br/>find all includes. It also means that if a certain translation unit<br/>cannot be compiled with clang (with relevantly interposed compilation<br/>flags), it cannot be analyzed.<br/>So i'd second the question regarding which includes you're having<br/>problems with.<br/>On 2/20/17 1:04 PM, Laszlo Nagy via cfe-dev wrote:<br/>> This question is related little to scan-build. scan-build calls clang,<br/>> so if you know how to compile your code with clang and use gcc<br/>> specific header files, then you got the answer... You shall know,<br/>> there are compiler specific header files, which you won't be able to<br/>> interchange between compilers. Please be more specific with your<br/>> question which header files you wish to be used. And also, in order to<br/>> get help, you need to tell more about your setup. (what os? what<br/>> version of gcc? which clang version? how clang got compiled? etc..)<br/>><br/>> On Mon, Feb 20, 2017 at 6:19 PM, 逆水x轻风 via cfe-dev<br/>> <cfe-dev@lists.llvm.org <mailto:cfe-dev@lists.llvm.org>> wrote:<br/>><br/>>     With --use-c=gcc and --use-analyzer=clang when run "scan-build" it<br/>>     will use include<...> of clang , but we need include<...> of gcc.<br/>>     How can I define the default include path of gcc when I run<br/>>     "scan-build --use-c=gcc --use-analyzer=clang make" ?<br/>>     _______________________________________________<br/>>     cfe-dev mailing list<br/>>     cfe-dev@lists.llvm.org <mailto:cfe-dev@lists.llvm.org><br/>>     <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br/>>     <<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev></a><br/>><br/>><br/>><br/>><br/>> _______________________________________________<br/>> cfe-dev mailing list<br/>> cfe-dev@lists.llvm.org<br/>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br/>