Page 2 of 2
Posted: Thu Jan 28, 2010 9:10 am
by hybrid
Don't know why ignoring a warning is worse than disabling the warning. IMHO, an app shouldn't generate warnings unless some code is really wrong and should be fixed. And in this case I'd say that a non-implemented pure virtual method in one of the pure virtual, and virtually derived base classes seems to be the error. This is definitely too much virtual in one sentence, so I guess it would never happen. If your class graph becomes so tightly linked, its smell is more than obvious and you should consider refactoring everything. Otherwise you'd lose many benefits the OO techniques could give you.
Posted: Thu Jan 28, 2010 9:32 am
by Ulf
And in this case I'd say that a non-implemented pure virtual method in one of the pure virtual, and virtually derived base classes seems to be the error.
The virtual method is implemented in CBaseClass which both CClassA and CClassB inherit from.
The warnings are because CClassA and CClassB both inherit the pure virtual function twice.
The compiler can still compile because it knows that the pure virtual function has been implemented in CBaseClass.
Yet it still delivers a warning.
Don't know why ignoring a warning is worse than disabling the warning
Because it's a pain in the ass to see the warnings scrolling down your output viewer. And if there are any errors amongst the warnings, then they are a pain in the ass to find. Don't you think so?