DEV300_m39, a note on pure virtuals

DEV300_m39 callcatcher report. Couple of modules go down, a couple go up. Balances out to retain 927 unused methods. The top three offenders remain sd, writerfilter and sc.

Note that if a method declared as pure virtual in class X then if an implementation of that method in class X is provided then it *does not* get called through the vtable, i.e. the body of that method is effectively a non-virtual method, to get called it has to be explicitly called somehow.

So that means that callcatcher is correct if it reports that a pure virtual method is unused. Virtual methods are ignored, but implementations of base-class pure virtuals are a different kettle of fish and can themselves be treated as non-virtuals.

class foo
{
public:
virtual void bar() = 0;
};

//Can only get called by an explicit call of foo::bar() on some concrete subclass of abstract superclass foo
void foo::bar()
{
//something
}

One Response to “DEV300_m39, a note on pure virtuals”

  1. hbrinkm says:

    Hi Caolán.

    Just a note about the unused symbols in writerfilter: They are artifacts of the code generation used. The issue is noted and queued. ;-)

Leave a Reply