[cfe-dev] Problem when using scan-build

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 20 06:57:57 PST 2017


The scan-build tool should be using the original compiler for compiling 
(transparently) and clang for analysis (inevitably). It means that both 
compilers need to compile the code independently (even though the clang 
instance that is used for analysis doesn't produce any binaries, all 
earlier phases of compilation need to occur), which means they need to 
find all includes. It also means that if a certain translation unit 
cannot be compiled with clang (with relevantly interposed compilation 
flags), it cannot be analyzed.

So i'd second the question regarding which includes you're having 
problems with.

On 2/20/17 1:04 PM, Laszlo Nagy via cfe-dev wrote:
> This question is related little to scan-build. scan-build calls clang, 
> so if you know how to compile your code with clang and use gcc 
> specific header files, then you got the answer... You shall know, 
> there are compiler specific header files, which you won't be able to 
> interchange between compilers. Please be more specific with your 
> question which header files you wish to be used. And also, in order to 
> get help, you need to tell more about your setup. (what os? what 
> version of gcc? which clang version? how clang got compiled? etc..)
>
> On Mon, Feb 20, 2017 at 6:19 PM, 逆水x轻风 via cfe-dev 
> <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>
>     With --use-c=gcc and --use-analyzer=clang when run "scan-build" it
>     will use include<...> of clang , but we need include<...> of gcc.
>     How can I define the default include path of gcc when I run
>     "scan-build --use-c=gcc --use-analyzer=clang make" ?
>     _______________________________________________
>     cfe-dev mailing list
>     cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>     <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list