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

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

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/2380153/finding-dead-$c$c-in-a-large-c-legacy-application\">Finding &ldquo;死code&rdquo;的在一个大的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.

推荐答案

您可以使用 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).

这问题可能是这其中的一个副本:死code检测传统的C / C ++项目

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

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

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