Code review comment for ~info-martin-konrad/epics-base:make-protected-dtors-non-virtual

Revision history for this message
Jeff Hill (johill-lanl) wrote :

I just now experimented with introducing one of the above changes and I immediately see warning from gcc.

base/timerQueueFix/src/libCom/timer/timer.cpp: In member function ‘virtual void Timer::destroy()’:
base/timerQueueFix/src/libCom/timer/timer.cpp:42:12: warning: deleting object of polymorphic class type ‘Timer’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
     delete this;

> gcc --version
gcc (SUSE Linux) 4.8.5

So I am not well convinced that this is a good idea. Our only cost for the pure virtual DTOR is a small increase in the VTBL size which is probably insignificant.

review: Needs Fixing

« Back to merge proposal