Brendon's point is a good one:
It avoids having to define special attributes in the code, the only
difference is the set of command line flags you pass to the compiler.
It does however mean that you cant provide function level
"enable/disable of static checking". I.e. It will check for all
functions whose implementation you find in the given translation unit.
Here we have a trade-off. Either a new attribute is added, which
allows function level "enable/disable of static checking" (but this
requires adding a new attribute) or a flag is added to the compiler,
thus disallowing function level enabling.

I think that finer control of enabledness is a must in order to avoid
warnings from external headers... Maybe there is another way to switch
between static/runtime checking (I have seen that pragma's have even
worse reputation than attributes, so I do not even mention them :D )
Using grep -v to eliminate warnings (as indicated for Weffc++) sounds
not very elegant to me...

With respect to Aaron:
This is a challenge to implement, as it needs to use
non-intrusive decorators and heuristics to allow the user to indicate
cases where exceptions logically won't propagate, even though they
'theoretically could.'  Complete static checking would end up being the
equivalent of -Weffc++: completely useless.
OK, but let me say that I am trying to accomplish a much more humble
task... At the beginning, the only information used will be the one
provided by programmer in the prototypes. Maybe someone later can save
the programer to write unuseful code. It seems to me that fully
accomplishing what you are talking about needs an algorithm for the
halting problem, and I plan to have such an algorithm not until 2009
:D .
        All the best,
          Sergio

Reply via email to