I have a big project with much dead code (big amount of unreferenced functions)
How can I detect functions in a class that are not used?
P.S.: The project uses C++ space, please don't offer ReSharper or .NET addons like this.
I have a big project with much dead code (big amount of unreferenced functions)
How can I detect functions in a class that are not used?
P.S.: The project uses C++ space, please don't offer ReSharper or .NET addons like this.
Controls the optimizations that LINK performs during a build.
/OPT:{REF | NOREF}
REF | NOREF /OPT:REF eliminates functions and data that are never referenced; /OPT:NOREF keeps functions and data that are never referenced. When /OFT:REF is enabled, LINK removes unreferenced packaged functions and data. An object contains packaged functions and data (COMDATs) if it was compiled by using the /Gy option. This optimization is known as transitive COMDAT elimination. By default, /OPT:REF is enabled in non-debug builds. To override this default and keep unreferenced COMDATs in the program, specify /OPT:NOREF. You can use the /INCLUDE option to override the removal of a specific symbol. When /OPT:REF is enabled either explicitly or by default, a limited form of /OPT:ICF is enabled that only folds identical functions. If you want /OPT:REF but not /OPT:ICF, you must specify either /OPT:REF,NOICF or /OPT:NOICF. If /DEBUG is specified, the default for /OPT is NOREF, and all functions are preserved in the image. To override this default and optimize a debugging build, specify /OPT:REF. Because /OPT:REF implies /OPT:ICF, we recommend that you also specify /OPT:NOICF to preserve identical functions in debugging builds. This makes it easier to read stack traces and set breakpoints in functions that would otherwise be folded together. The /OPT:REF option disables incremental linking. You have to explicitly mark const data as a COMDAT; use __declspec(selectany). Specifying /OPT:ICF does not enable the /OPT:REF option.
15 seconds of googling gave me this:
In the build menu select run code analysis on your YourProjectName. In the output window you should see a warning like this for unused sub routines