|
![]() Click on image to see enlargment |
|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home bug1509.cpp
The purpose of the exercise above is to show in principle how people of differing nationalities can give a farewell address in their native language. Unfortunately, the farewells are never given, and we even got a crash. What's going wrong? bug1509.cpp lint Output
--- Module: bug1509.cpp
_
{ public: virtual ~Englishman(){ printf( "Goodbye\n" ); } };
bug1509.cpp(6) : Warning 1509: base class destructor for class 'Person' is not virtual
_
{ public: virtual ~Japanese(){ printf( "Sayonara\n" ); } };
bug1509.cpp(9) : Warning 1509: base class destructor for class 'Person' is not virtual
_
{ public: virtual ~German(){ printf( "Auf Wiedersehen\n" ); } };
bug1509.cpp(12) : Warning 1509: base class destructor for class 'Person' is not virtual
--- Wrap-up for Module: bug1509.cpp
Info 753: local class 'Englishman' (line 4, file bug1509.cpp) not referenced
--- Global Wrap-up
Warning 1512: destructor for base class 'Person' (line 3, file bug1509.cpp) is not virtual
Reference Manual Explanation
1509 base class destructor for class 'Name' is not virtual -- The indicated
class is a base class for some derived class. It has a non-virtual destructor.
Was this a mistake? It is conventional to virtualize destructors of base
classes so that it is safe to delete a base class pointer. [19]
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #1559 - July 2005