[cfe-dev] Run clang on multiple source files specified by wild card

Jordan Rose jordan_rose at apple.com
Fri Oct 19 08:50:23 PDT 2012


Hi, Sujit. The recommended way of running the static analyzer is by using scan-build to wrap your regular command-line build system. (See http://clang-analyzer.llvm.org/scan-build.html) With scan-build, you do get a summary page (though in HTML format rather than XML, alas).

If you don't have a build system to wrap, I'd /still/ suggest using scan-build. The page I linked above has this example:

> scan-build cc -c t1.c t2.c


As for wildcard matching, while Clang won't expand the wildcard, your shell will. As long as you're running the command in a shell, using an asterisk (star) should work just fine.

Does that solve your problems?
Jordan


On Oct 19, 2012, at 1:40 , Sujit Kamthe <Sujit.Kamthe at kpitcummins.com> wrote:

> Hi,
> According to my understanding currently we cannot run clang static analyzer on multiple source files (we can specify list of files separated by space but there is no support for wild card).
> We cannot specify list of source files by some path pattern.
> e.g. /home/sujit/source/*.c
>  
> Also if we can generate an XML report for the analysis which will contain all the violations or errors then it will be more helpful to present the report in nice looking HTML format.
> A consolidated XML report should be generated for all the source files being analyzed.
>  
> Is it possible to implement this?
>  
>  
> Regards,
> Sujit Kamthe
>  



More information about the cfe-dev mailing list