Add dead code warning of C code to Visual Studio 2022
I use Visual Studio 2022 to build my C project and OpenCppCoverage to check the coverage.
With these tools, I don't find how to find C functions (static & public) that aren't called. The /Zi option may not produce a PDB with the uncalled function and OpenCppCoverage is unable to detect it:
As the goal is to detect dead code, one option is to add a warning to visual studio 2022 compilator or linker to raise an error in case of unused function as gcc or to produce a PDB that contain information about the uncalled function (The second option may not work).
Anyone have an idea to detect dead code with these tools?