gcc -Iproto -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DHAVE_PATHDEF -DFEAT_BIG -DMS_WIN64 -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_OLE -DFEAT_CSCOPE -DFEAT_CHANNEL -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -march=x86-64 -Wall -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python32.dll\" -DFEAT_XPM_W32 -I xpm/x64/include -I xpm/x64/../include -O3 -fomit-frame-pointer -freg-struct-return -s -c -o gobjx86-64/if_ole.o if_ole.cpp
if_ole.cpp: In static member function 'static CVim* CVim::Create(int*)':
if_ole.cpp:163:13: warning: deleting object of polymorphic class type 'CVim' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete me;
^
if_ole.cpp:171:13: warning: deleting object of polymorphic class type 'CVim' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete me;
^
if_ole.cpp:184:13: warning: deleting object of polymorphic class type 'CVim' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete me;
^
if_ole.cpp:197:9: warning: deleting object of polymorphic class type 'CVim' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete me;
^
if_ole.cpp: In function 'void UninitOLE()':
if_ole.cpp:795:9: warning: deleting object of polymorphic class type 'CVim' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete app;
^
if_ole.cpp:802:9: warning: deleting object of polymorphic class type 'CVimCF' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete cf;
^
This should help:
https://gcc.gnu.org/wiki/VerboseDiagnostics#delete-non-virtual-dtor
PS: you also have this one:
gui_dwrite.cpp:348:13: warning: deleting object of polymorphic class type 'GdiTextRenderer' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete this;
^
These warnings are all false positive because we don't inherit the classes.
I think there are two options to suppress the warnings:
1. Add "virtual" to the each destructor. Or,
2. Use "final" specifier which is available from C++11.
(See the attached patch.)
Regards,
Ken Takata