静态code分析仪对C [英] Static code analyzers for C

查看:144
本文介绍了静态code分析仪对C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其中静态code分析仪(如果有的话),你呢?我一直在使用pylint的Python和我pretty满意,现在我需要对C code类似的东西。

Which static code analyzer (if any) do you use? I've been using PyLint for Python and I'm pretty satisfied with it, now I need something similar for C code.

多少它的输出你必须要喝正常的日常使用preSS?

How much of it's output do you have to suppress for normal daily usage?

推荐答案

维基百科保持的的静态code分析工具列表各种语言(包括C)。

Wikipedia maintains a list of static code analysis tools for various languages (including C).

就个人而言,我都用了 PC-林特 和的 夹板 。最好的选择取决于你写的应用程序类型。但是无论你使用的工具,就会有一个低信噪比,直到你正确地调整工具,你的code。

Personally, I have used both PC-Lint and Splint. The best choice depends on the type of application you have written. However no matter which tool you use, there will be a low signal to noise ratio until you properly tune the tool and your code.

PC-林特是最有力的工具,皮棉我用。如果你将它添加到现有的项目中,信噪比可以很低。然而,一旦工具和你的code正确配置,它可以被用来作为你的标准构建过程的一部分。在这里,我用它的最后一个主要项目,我们设置它,以便 PC-林特警告会破坏身材。对于PC-林特许可花费$ 389,但它是值得的成本。

PC-Lint is the most powerful Lint tool I used. If you add it to an existing project, the signal to noise ratio can be low. However, once the tool and your code are properly configured, it can be used as part of your standard build process. The last major project where I used it, we set it so that PC-Lint warnings would break the build. Licenses for PC-Lint cost $389, but it is worth the cost.

夹板是一个伟大的开源工具。我已经用它的几个项目,却发现它可能很难使用非ANSI C extenstions一个编译器(例如嵌入式系统项目)时进行配置。

Splint is a great open-source tool. I have used it on several projects, but found that it can be difficult to configure when using a compiler with non-ANSI C extenstions (e.g. on embedded systems projects).

Valgrind的 也是值得考虑作为一个动态的分析工具。

Valgrind is also worth considering as a dynamic analysis tool.


您特别要求对 SourceMonitor 反馈。此工具提供您code有趣的指标,但应作为一个补充,良好的lint工具,因为它并没有提供这种分析。

You specifically requested feedback on SourceMonitor. This tool provides interesting metrics on your code, but should be used as a supplement to good Lint tool as it does not provide that kind of analysis.

由于在其主页上表示, SourceMonitor 将:

As stated on their home page, SourceMonitor will:

...看看你有多少code和有
  以确定的相对复杂
  你的模块。例如,你可以使用
  SourceMonitor识别code
  这是最有可能包含缺陷
  因此权证正式​​审查。

...find out how much code you have and to identify the relative complexity of your modules. For example, you can use SourceMonitor to identify the code that is most likely to contain defects and thus warrants formal review.

我用它在最近的一个项目,并发现它很容易使用(甚至是嵌入式系统code)。复杂性度量是开发code,这将是不易出错,更容易维护的优秀资源。

I used it on a recent project and found it to be easy to use (even for embedded systems code). The complexity metric is an excellent resource for developing code that will be less error-prone and easier to maintain.

SourceMonitor 如果你想自动指标收集其输出提供的漂亮图形,以及良好的XML格式。唯一不足的是,该工具只能运行在Windows操作系统。

SourceMonitor provides nice graphs of its output as well as well-formatted XML if you want to automate metrics collection. The only downside is that the tool only runs on Windows.

这篇关于静态code分析仪对C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆