Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#312766 - 07/08/2008 11:22 C++ code analysis tools
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
Any good ones out there? Preferably integrated with Visual Studio, but something that'll tell me (given a project) that a particular function/variable is never used. Or that a variable could be moved closer to the place where it's used.

Stuff like that.
_________________________
-- roger

Top
#312774 - 07/08/2008 17:19 Re: C++ code analysis tools [Re: Roger]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Doesn't VS come with a profiler?
_________________________
Bitt Faulk

Top
#312780 - 07/08/2008 19:13 Re: C++ code analysis tools [Re: Roger]
siberia37
old hand

Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
The compiler should tell you if a variable is never used unless you turn that warning off. As far as knowing if a variable has too high a scope, I've never heard of such a tool.

Top
#312782 - 07/08/2008 19:46 Re: C++ code analysis tools [Re: Roger]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4174
Loc: Cambridge, England
What you want is something like GCC's "-Weffc++" on steroids. In fact, what you really want is a refactoring browser.

http://c2.com/cgi/wiki?ThereIsNoRefactoringBrowserForCpp

although that page title seems to underestimate the actual number by about four: Xrefactory, Slickedit, possibly Ref++ (whose websites seem to have disappeared), and Devexpress Refactor. I haven't used any of them, though.

Peter

Top
#312784 - 08/08/2008 05:21 Re: C++ code analysis tools [Re: wfaulk]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
Originally Posted By: wfaulk
Doesn't VS come with a profiler?


That implies that I have to run the program, and go through the entire test suite on six different versions of Windows.

I'd prefer static analysis...
_________________________
-- roger

Top
#312785 - 08/08/2008 05:30 Re: C++ code analysis tools [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
Originally Posted By: peter
What you want is something like GCC's "-Weffc++" on steroids. In fact, what you really want is a refactoring browser.


-Weffc++ on steroids is pretty much what I'm looking for, yeah.

Quote:
Xrefactory, Slickedit, possibly Ref++ (whose websites seem to have disappeared), and Devexpress Refactor.


I tried Devexpress Refactor and Visual Assist X. On C++, neither of them is up to the standard of ReSharper (although ReSharper gets to play with .NET languages, which is probably easier).

The problem is not so much that I'm refactoring C++. The problem is that I'm refactoring legacy C code, and trying to turn it into C++.

I'll look at the others, thanks.
_________________________
-- roger

Top