Page 1 of 1

wxSharedPtr warnings..... what should i do?

Posted: Mon Oct 22, 2018 1:08 pm
by Parduz
Using Code::blocks on a Windows PC

I want to compile the wxCharts libraries.

I get 144 warnings, all saying the same:

Code: Select all

||=== Build: Debug Win32 in wxcharts (compiler: GNU GCC 6.3.0 Compiler) ===|

C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h||In instantiation of 'void wxSharedPtr<T>::reftype::delete_ptr() [with T = wxChartTooltipProvider]':|
C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h|149|required from 'void wxSharedPtr<T>::Release() [with T = wxChartTooltipProvider]'|
C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h|41|required from 'wxSharedPtr<T>::~wxSharedPtr() [with T = wxChartTooltipProvider]'|
C:\SVILUPPO\Toolchains\wxCharts-master\src\wxareachart.cpp|95|required from here|
C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h|119|warning: deleting object of abstract class type 'wxChartTooltipProvider' which has non-virtual destructor will cause undefined behavior [-Wdelete-non-virtual-dtor]|
I know wxCharts is not a wxWidgets library, but i think i should ask here (if not, sorry).

What should i do to avoid all these warnings?

Re: wxSharedPtr warnings..... what should i do?

Posted: Wed Oct 24, 2018 11:30 am
by Kvaz1r
First of all warnings it's not errors, so you should be able to compile the source.
But since usually warnings are helpful you could open new issue or try to fix it and open PR.
As far I understand for this case enough to add virtual destructor for class .