码迷,mamicode.com
首页 > 其他好文 > 详细

使用static analyzer发现更多潜在问题。

时间:2015-09-11 19:16:28      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:

from: iOS Good Practices

The Clang compiler (which Xcode uses) has a static analyzer that performs control and data flow analysis on your code and checks for lots of errors that the compiler cannot.

You can manually run the analyzer from the Product → Analyze menu item in Xcode.

The analyzer can work in either “shallow” or “deep” mode. The latter is much slower but may find more issues due to cross-function control and data flow analysis.

Recommendations:

  • Enable all of the checks in the analyzer (by enabling all of the options in the “Static Analyzer” build setting sections).
  • Enable the “Analyze during ‘Build’” build setting for your release build configuration to have the analyzer run automatically during release builds. (Seriously, do this — you’re not going to remember to run it manually.)
  • Set the “Mode of Analysis for ‘Analyze’” build setting to Shallow (faster).
  • Set the “Mode of Analysis for ‘Build’” build setting to Deep.

使用static analyzer发现更多潜在问题。

标签:

原文地址:http://www.cnblogs.com/gabrialrx/p/4801485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!