Re: Compiling without warnings issues

Hold on! Your compiler is telling you something!

./Utils/Uri.h:148: warning: base class ‘class QSharedData’ has a
non-virtual destructor

In Java you have a keyword which is called final, in C# it is sealed. If the classes are declared with this words you can not inherit from them. In C++ we do not have this possibility. But if you derived from a class which does not have a virtual destructor, the class is not designed for derivation. With other words you should use it as a base class. This is the same with classes from stl (vector etc.)

Regards,

Markus

Would you like to post a relpy?


This post is a reply to:
Re: Compiling without warnings issues
Hi Petr, Maybe we should create a list with warnings that are being “ignored” (resolved as non-problematic and hard/superfluous to fix)? That's a good idea! We could keep a list of warnings (more...)

Follow-ups:
Re: Compiling without warnings issues
Hi Markus, In Java you have a keyword which is called final, in C# it is sealed. If the classes are declared with this words you can not inherit from them. (more...)
Re: Compiling without warnings issues
Can I edit my old post? The main sentence is wrong. :-( I want to say "With other words you should NOT use it as a base class". The completely opposite! ;-)