RE: [GD-General] C++ analyzers?
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2002-07-18 19:41:22
|
Quite true, and this illustrates my earlier comments of how bad most software development tools. Something as conceptually simple as renaming a variable can be incredibly difficult to manage. Even using a standard automated tool like perl or sed/awk you run into the problem that there's no context. We have tools to automatically generate code and do all other kinds of fluff crap, but if you actually want something that can go through and rename all instances of "m_foo" for all instances of class "CBar", it doesn't seem possible. If we don't even have tools that can tell you something as trivial as what variables are unused, then the above doesn't seem likely to happen any time soon =) MSVC doesn't warm that: int i = 0; is an unused variable even if you don't use it anywhere. And any class with a constructor also won't trigger the warning, even if the constructor doesn't do anything. So I find myself with lots of temporaries, etc. that are laying around that I didn't realize that are there or are no longer using. A common example is when you create a temporary solely to make debugging easier: foo f; f = blah(); callSomefunction( f ); But then later you fix the bug, restructure the code, etc. and do: callSomefunction( blah() ); But you forget that "foo f" is still there. And it's gonna stay there forever now =) One of the nicer aspects of ANSI C is that since there aren't hidden operations like constructors, destructors, etc. then it can be a lot more stringent about finding things like that. That ebrowser thing might be nice. Brian > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Brian Sharon > Sent: Thursday, July 18, 2002 12:28 PM > To: gam...@li... > Subject: RE: [GD-General] C++ analyzers? > > > I hope I'm not guilty of stating the blatantly obvious, but > renaming variables and checking in has to be one of the > classic "I couldn't have broken the build, I didn't change > anything" moves. I wouldn't think renamed symbols are a good > thing to ignore, if you're trying figure out why things that > used to work no longer do. |