
Wanted: source code dead code remover
Quote:
>I looking for a program that will act as a global (i.e. over a whole)
>program dead code remover that works on source code. In other words,
>it analyzes the program from back to front and removes code that
>is not used in output. These things exist at least for single routines
>inside compilers. Has anybody tried to write a source code one??
Doing this over a whole program is problematical. You have to include
all the modules that make up the program as well as all the library
routines that will be linked in. If you want something that looks at
a single file program or a single module of of a larger program then you
can do this by declaring everything static that isn't intended to be used
outside of the module. Most modern compilers have switches to warn about
these functions if they are not actually referenced within the module.
--
D'Arcy Cain Consulting | There's no government
Toronto, Ontario, Canada | like no government!
+1 416 424 2871 DoD#0082 |