首页 > 其他 > 详细

xcode之静态扫描( Xcode static analyzer)

时间:2014-02-09 21:10:29      阅读:535      评论:0      收藏:0      [点我收藏+]

Static Analysis 是基于Clang 的非常好的静态代码分析工具。

主要从以下几个方面进行检测:

  • Logic flaws, such as accessing uninitialized variables and dereferencing null pointers(逻辑错误,比如访问未初始化的变量、解引用空指针)

  • Memory management flaws, such as leaking allocated memory(内存管理错误,比如内存泄露,在MRC机制下很有用)
  • Dead store (unused variable) flaws(死存储,比如未使用的变量)
  • API-usage flaws that result from not following the policies required by the frameworks and libraries the project is using(API使用错误)
使用方法:

1、点击product -> Analyze(shift+command+B)


bubuko.com,布布扣

2、选择某一条分析消息


bubuko.com,布布扣

3、点击相应的消息


bubuko.com,布布扣

4、点击箭头,查看错误跟踪线


bubuko.com,布布扣

5、编辑代码修改错误


xcode之静态扫描( Xcode static analyzer)

原文:http://blog.csdn.net/tingxuan_qhm/article/details/19013815

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!