Any easy way to find functions that are not called

  • Thread starter Thread starter Frank Lopez
  • Start date Start date
F

Frank Lopez

Question: Is there any way to use the Visual Studio .NET environment
to easily identify C and C++ functions that are not called?

If not, does anyone have any recommendations on some other software
that I can quickly get my hands on to do this?

Right now, I only need to do it once.
 
Frank said:
Question: Is there any way to use the Visual Studio .NET environment
to easily identify C and C++ functions that are not called?

If not, does anyone have any recommendations on some other software
that I can quickly get my hands on to do this?

Right now, I only need to do it once.

Compile everything with /Gy.

Link with /opt:ref and /verbose. Search the linker output (it could be
quite long -redirect it into a file) for lines that start with Discarded:
these are your uncalled functions. Note that some of them will be
libraries, not your code.

If you have uncalled virtual functions, they're harder to find because the
compiiler will force a reference to them so the linker won't pick them out.

-cd
 
Back
Top