kactus2 / kactus2dev

Kactus2 is a graphical EDA tool based on the IP-XACT standard.
https://research.tuni.fi/system-on-chip/tools/
GNU General Public License v2.0
191 stars 34 forks source link

deleting object of polymorphic class type 'SubspaceMapValidator' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor] #54

Closed olofk closed 1 year ago

olofk commented 2 years ago

Getting a different error message when I recompile

End of make ouput:

/usr/include/qt5/QtCore/qsharedpointer_impl.h:479:55:   required from 'void QSharedPointer<T>::internalConstruct(X*, Deleter) [with X = AddressBlockValidator; Deleter = QtSharedPointer::NormalDeleter; T = AddressBlockValidator]'
/usr/include/qt5/QtCore/qsharedpointer_impl.h:316:24:   required from 'QSharedPointer<T>::QSharedPointer(X*) [with X = AddressBlockValidator; typename std::enable_if<std::is_convertible<_Up*, _Tp*>::value, bool>::type <anonymous> = true; T = AddressBlockValidator]'
PythonAPI.cpp:531:90:   required from here
/usr/include/qt5/QtCore/qsharedpointer_impl.h:187:26: warning: deleting object of polymorphic class type 'AddressBlockValidator' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
  187 |         void execute() { delete ptr; }
      |                          ^~~~~~~~~~
/usr/include/qt5/QtCore/qsharedpointer_impl.h: In instantiation of 'void QtSharedPointer::CustomDeleter<T, QtSharedPointer::NormalDeleter>::execute() [with T = SubspaceMapValidator]':
/usr/include/qt5/QtCore/qsharedpointer_impl.h:205:36:   required from 'static void QtSharedPointer::ExternalRefCountWithCustomDeleter<T, Deleter>::deleter(QtSharedPointer::ExternalRefCountData*) [with T = SubspaceMapValidator; Deleter = QtSharedPointer::NormalDeleter]'
/usr/include/qt5/QtCore/qsharedpointer_impl.h:479:55:   required from 'void QSharedPointer<T>::internalConstruct(X*, Deleter) [with X = SubspaceMapValidator; Deleter = QtSharedPointer::NormalDeleter; T = SubspaceMapValidator]'
/usr/include/qt5/QtCore/qsharedpointer_impl.h:316:24:   required from 'QSharedPointer<T>::QSharedPointer(X*) [with X = SubspaceMapValidator; typename std::enable_if<std::is_convertible<_Up*, _Tp*>::value, bool>::type <anonymous> = true; T = SubspaceMapValidator]'
PythonAPI.cpp:534:73:   required from here
/usr/include/qt5/QtCore/qsharedpointer_impl.h:187:26: warning: deleting object of polymorphic class type 'SubspaceMapValidator' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
make[1]: *** [Makefile:544: release/PythonAPI.o] Error 2
make[1]: Leaving directory '/home/olof/projects/kactus2/kactus2dev/PythonAPI'
make: *** [Makefile:111: sub-PythonAPI-make_first] Error 2
epekkar commented 2 years ago

Hi Olof,

Thanks for reporting these. I will be looking into the Linux build. There seems to be multiple issues with it.