JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
virtual destructor and warnings | Reply
bmerry is obviously right. g++ does warn about this problem, the correct option to achieve this effect is -Wnon-virtual-dtor (enabled by -Wall). I don't know about other compilers, though.
Re: virtual destructor and warnings (response to post by Krzysan) | Reply
I obviously did not say bmerry was wrong. I have a note at the end of the article about which compilers i used to test for the warnings. Unfortunately, at that time i only had a Windows box (maybe a poll about how many TopCoders use Windows or Linux for the design/development woulb be nice) to use for testing. I tried the Mingw compiler (which is based on gcc) but it did not warn. What i did not test and could be worth trying, was Eclipse with the gcc that comes with Cygwin. Also i wanted to see if the default installations of those tools provide the warnings for that situation (i would say they should).
Re: virtual destructor and warnings (response to post by zmij) | Reply
I appreciate your efforts for checking that, I'm just saying that you passed wrong flags to g++ and the warning is enabled by -Wall instead of -Wextra.
Re: virtual destructor and warnings (response to post by Krzysan) | Reply
Indeed you're right!
I rechecked the code with the Mingw (from DevCpp) compiler and it warns.
Either with -Wnon-virtual-dtor or with -Wall (which is a little bit too broad). It eluded me the first time.

Thanks for pointing it out!
RSS