How to use clang static code analysis without building a project


I’m new to Objective-C and whole iOS platform, but I’d know if there is a possibility to use Clang without building whole project.

I’m doing security assessments and sometimes they include code review. I’d like to write some scripts that would use clang and analyze code before I’ll read it manually. The main problem is that, I’m not always able to compile code. Sometimes I get only source code without external dependencies and I can’t build and run it, so my main question is:

Is Clang able to analyze code without building it? Is there any clang API to use it outside the XCode, in some scripts that will run it, and get clang’s results? I just read that there is console runner, but when I briefly read the docs, I saw that that console tool builds project.

Thx in advance


As far as I know, clang cant analyze without building. There are good
technical reasons for this, but ive forgotten what they are though.

Sorry. Perhaps you can convince the people that provide you the code
that you cant do proper analysis without being able to build it, so
that they will supply you buildable projects in the future.

John Smith.