在C / C ++中识别未使用的函数 [英] Identifying Unused Functions in C/C++

查看:153
本文介绍了在C / C ++中识别未使用的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

查找死代码在大型C ++遗留应用程序中

我的项目有很多C源文件每个都有很多全局函数。很多这些都不再被任何调用者引用。是否有一个简单的方法来识别这些函数哪些没有被任何人引用?

My project has a lots of C source files each with a lots of global functions. Many of these are no longer referenced by any caller at all. Is there a simple way to identify which of these functions are not referenced by anyone at all?

VC生成的映射文件似乎是有用的。但我不确定如何/当一个函数名称在地图文件中列出。

The map file generated by VC seems to be useful. But I am not sure exactly how/when a function name is listed in the map file.

推荐答案

=http://cccc.sourceforge.net/ =nofollow> CCCC (免费,开源),它为您提供了大量关于您的计划的指标。另一个选项是 Coverity (非免费)。

You can use CCCC (free, open source) which gives you lots of metrics about your program. Another option would be Coverity (not free).

此问题可能与以下问题重复:旧版C / C ++项目中的死代码检测

This question may be a duplicate of this one: Dead code detection in legacy C/C++ project

这篇关于在C / C ++中识别未使用的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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