DraconisRex
Member
I'm working on writing an adapter class that will allow me to quickly plug-in different ILI9341 libraries.
I get a compilation warning in my wrapper class for the ILI9341_t3 class because it implements the Print interface, but does not provide a virtual destructor. In my day job all warnings are treated as errors, and I feel the same about code I write for myself. This really should be fixed since it transgresses into the realm of undefined behavior.
I get a compilation warning in my wrapper class for the ILI9341_t3 class because it implements the Print interface, but does not provide a virtual destructor. In my day job all warnings are treated as errors, and I feel the same about code I write for myself. This really should be fixed since it transgresses into the realm of undefined behavior.
Code:
C:\Users\SPC\Documents\Arduino\libraries\SPC\Teensy3ILI9341Adapter.cpp: In destructor 'virtual Teensy3ILI9341Adapter::~Teensy3ILI9341Adapter()':
C:\Users\SPC\Documents\Arduino\libraries\SPC\Teensy3ILI9341Adapter.cpp:8:10: warning: deleting object of polymorphic class type 'ILI9341_t3' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
delete _tft;
^
Last edited: