On 21.11.2011 23:32, André Pönitz wrote:
On Mon, Nov 21, 2011 at 10:53:49PM +0100, Peter Kümmel wrote:
On 21.11.2011 21:24, André Pönitz wrote:
First guess: gcc sees 'virtual' on two member functions but no virtual
destructor, cannot prove that delete operates only on static type ==
Yes, seems the warning is completely valid: GuiWorkArea::Private has a
virtual table but no virtual destructor. It points to superfluous
virtual functions which are wrong in GuiWorkArea::Private and only
slow down the code.
We seem to have different opions on what constitutes a "valid" warning.
I am not a native English speaker, but in my limited understanding of
the language
"GuiWorkArea.cpp:327:9: warning: deleting object of polymorphic class type
‘lyx::frontend::GuiWorkArea::Private’ which has non-virtual destructor might
cause undefined behaviour "
But this statement is still correct (polymorphic and non-virtual destructor),
the other was only my optinion. It is like a hint to a coding-rule.
and
"GuiWorkArea.cpp:112:9: warning: declaring a virtual function in a
class that is never subclassed might make generated code slower than
needed when using bad code generators which are not able to substitute
a direct base call after detecting the fact. As I am a good compiler
and just detected the possibility to perform said optimization, I just
applied it and did not even bother you with a warning.
Now, please forget what you just saw."
are not equivalent.
Andre'
PS: Spoiler ahead.
The line numbers differ.