Automated Dead code detection in native C++ application on Windows?

前端 未结 3 613
暗喜
暗喜 2021-02-02 01:22

Background

I have an application written in native C++ over the course of several years that is around 60 KLOC. There are many many functions and classes that are dead

相关标签:
3条回答
  • 2021-02-02 01:40

    Ask the linker to remove unreferenced objects (/OPT:REF). If you use function-level linking, and verbose linker output, the linker output will list every function it can prove is unused. This list may be far from complete, but you already have the tools needed.

    0 讨论(0)
  • 2021-02-02 01:52

    We use Bullseye, and I can recommend it. It doesn't need to be run from a unit test environment, although that's what we do.

    0 讨论(0)
  • 2021-02-02 01:55

    Use a code coverage tool against your unit test suite.

    0 讨论(0)
提交回复
热议问题