Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 1. Introducing Objective-C > Using the Xcode Static Analyzer

1.3. Using the Xcode Static Analyzer

One of the biggest improvements to compiler technology included in the Xcode development environment over the last couple of years has been the inclusion of the Clang Static Analyzer. The Clang Static Analyzer is a tool for analyzing source code to detect common errors. Though compilers are good at detecting some errors, they generally tend to err on the side of speed and forsake the detection of some conditions that are more complicated to find. As a result, some otherwise detectable errors, errors that one might detect through code review, often go undetected and result in bugs in your application. Examples of these kinds of errors are failure to release allocated memory, infinite loops, and use of uninitialized variables, to name a few. Typical compilers are unable to detect most of these errors. The Clang Static Analyzer was created specifically to fill this gap.

To run the Clang Static Analyzer on your source code, you simply choose Build Build and Analyze. This will cause your source code to first be built using the compiler, and then the static analyzer will be run.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial