Jon Berndt wrote:
Is there a way to determine which methods/attributes in a class are unused
by anybody? I'm thinking maybe there's a utility out there somewhere or a
link directive. This would assist in code streamlining/cleanup.
Other than grep :-) You can browse through lists of references, looking for empty lists, in a source browser like the ones in MS Visual C++ and Source Navigator (formerly by Red Hat, now a SourceForge project). In MSVC you can only browse, as far as I know, but Source Navigator is open-source and uses Perl or Python scripts to do much of its user interface, so it's probably not hard to get it to output the list of unreferenced symbols. Others IDEs like KDevelop list definitions and declarations but not references.

Getting the linker to tell you is an interesting idea that I haven't looked into. Perhaps you could do this manually by listing the public symbols in each library first, and then in the linked application, and comparing the two lists. Or perhaps you can make one list of all the exported symbols from the application and its libraries, and another list of all the imported symbols, and compare those. The unix utilities "nm" and "objdump" can list symbols in object files and libraries.

I haven't come across a utility specifically for doing this, but I'd be interested.

- Julian


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Reply via email to