06 Nov, 2009, Asylumius wrote in the 1st comment:
Votes: 0
Feeling nostalgic, I'm going through a very old, buggy, junky codebase from years ago and cleaning it up.

One thing I'd like to do is identify stuff that isn't used anymore. Functions, macros, whole files, etc. Currently, I'm using a lot of fragile command line fu and regex, but I'm wondering if there is another (better) way to do generic code clean up.

Also, I remember seeing something in RaM that went through all the code and formatted it against a template or something like that. Anyone remember what that utility is called?
06 Nov, 2009, Tijer wrote in the 2nd comment:
Votes: 0
theres the standard indent function and i think you can download astyle which allows you to format your code nicely
06 Nov, 2009, David Haley wrote in the 3rd comment:
Votes: 0
You can look for code coverage analysis, or call graphs. Drawing a call graph will show you which functions are never called in any execution, and coverage analysis can show you which code is not called at runtime.
08 Nov, 2009, bbailey wrote in the 4th comment:
Votes: 0
Asylumius said:
One thing I'd like to do is identify stuff that isn't used anymore. Functions, macros, whole files, etc. Currently, I'm using a lot of fragile command line fu and regex, but I'm wondering if there is another (better) way to do generic code clean up.


Splint has been very useful to me for static analysis of C code.
21 Nov, 2009, Mudder wrote in the 5th comment:
Votes: 0
Splint is made for C, can it be adapted for C++? Or is there something similar for C++ ?
21 Nov, 2009, David Haley wrote in the 6th comment:
Votes: 0
Mudder said:
Splint is made for C, can it be adapted for C++?

Apparently, no. At least not without doing it yourself.

Mudder said:
Or is there something similar for C++ ?

There are tools like Coverity, but it's not free. Don't know of any free ones.
21 Nov, 2009, bbailey wrote in the 7th comment:
Votes: 0
Mudder said:
Splint is made for C, can it be adapted for C++? Or is there something similar for C++ ?


I haven't worked with it myself, but check out cppcheck. Found the recommendation on stackoverflow.
0.0/7