Eclipse:如何在 .h 中查找在 .cpp 中没有实现的函数?

Eclipse: how to find functions in .h that have no implementation in .cpp?

如何在 .h 文件中查找在 .cpp 文件中没有实现且从未使用过的函数?

如果存在此类功能,Eclipse 似乎不会发出警告或错误。

如果重要的话,我在 Ubuntu 14.04.

上使用 Eclipse Version: 3.8.1

Eclipse 确实有一个未使用函数声明的检查器,可以在 Preferences -> C/C++ -> Code Analysis 中启用,但它只检查 .cpp 文件中的函数声明,而不是头文件。

检查器可以有选项(可以通过单击该首选项页面上的 "Customize Selected..." 进行配置),并且向 "Unused function declaration" 检查器添加一个选项以检查头文件也可能有意义.

您可以file an issue请求添加这样的选项。

有兴趣的也可以考虑contributing a patch that implements such an option. It would be a relatively straightforward change to the existing checker code。我对这段代码有一些经验,我很乐意指导您(或其他任何人)进行此类更改。