Dear all,
I have a C++ project, which contains some head files(.h) and several source files(.cpp).
Now I want to anlyze the project through Clang. What is the command to do the analysis?


Are you asking about the clang static analyzer?

The scan-build utility can be used to analyze a project from command line. The clang static analyzer is also integrated within Xcode IDE. See the UserManual at for more details.


Dear All,
When I run the command “scan-build make”, it will report the error message:
scan-build: Exectuable ‘c++ analyzer’ does not exist at ‘$SOMEPATH/clang/tools/scan-build/c+±analyzer’;

I am confused with the error message. what should I do to overcome the error?

I was suggesting to download the latest scan-build package from the analyzer website and follow the instructions in the User Manual on how to run it. That should be sufficient if you just want to test your project with the existing analyzer. Does that not work for you?