Possible Duplicate:
Finding “dead code” in a large C++ legacy application
My project has a lots of C source files each with a lots of global functions. Many of these are no longer referenced by any caller at all. Is there a simple way to identify which of these functions are not referenced by anyone at all?
The map file generated by VC seems to be useful. But I am not sure exactly how/when a function name is listed in the map file.
You can use CCCC (free, open source) which gives you lots of metrics about your program. Another option would be Coverity (not free).
This question may be a duplicate of this one: Dead code detection in legacy C/C++ project