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

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


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.


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.


Use a code coverage tool against your unit test suite.