Debugging with Clang

I would like to use clang in my iPhone Xcode project. However, this getting started guide:

http://clang.llvm.org/get_started.html

I have been working with Xcode for a year, but this is far from clear to me! Can someone explain in English how to install and use Clang with my existing iPhone project? I am not familiar with loading things from the console.

Thanks!

Dan

+4
source share
3 answers

Nikita Zhuk wrapped Clang in a graphical interface and made it available at http://www.karppinen.fi/analysistool/ . Very useful.

+7
source
  • Download and extract the clang distribution to some directory. Optionally add this directory to your path or you can simply add its location to the command line later.
  • cd to the top-level project directory (maybe something like cd ~ / Documents / yourprojectdirectory )
  • Tell clang to build the project using the xcode project settings by entering the following command line: pathtoclangdirectory / scan-build -o./clang_out xcodebuild
  • The utility should provide you with a message after the scan_view program successfully runs .
  • Run the command that was output at the end of the assembly. This will launch a temporary web server on your computer and then open Safari and show you the code analysis. You may need to add the path to your clang directory again, for example: pathtoclangdirectory / scan_view ...
+3
source

I did not see this question until I did something similar to make Clang more useful inside Xcode:

Using Clang Static Analyzer from Xcode

+1
source

All Articles