arduino-libraries/ArduinoIoTCloud

`-Wdelete-non-virtual-dtor` compiler warnings

zfields opened this issue · 0 comments

Running this Arduino CLI command from the folder of a sketch that #includes the "ArduinoIoTCloud" library:

arduino-cli compile --verbose --warnings=all --build-property "build.extra_flags=-Wno-unused-variable -Wno-implicit-fallthrough -Wno-psabi -Wno-deprecated-copy -Wno-missing-field-initializers -Wno-vla -Wno-sign-compare -Og -g" --fqbn arduino:mbed_opta:opta

results in this compiler warning:

~/Development/Arduino/libraries/ArduinoIoTCloud/src/ota/interface/OTAInterfaceDefault.cpp: In member function 'virtual OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch()':
~/Development/Arduino/libraries/ArduinoIoTCloud/src/ota/interface/OTAInterfaceDefault.cpp:150:12: warning: deleting object of polymorphic class type 'HttpClient' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
     delete http_client;
            ^~~~~~~~~~~
______________________________________________

~/Development/Arduino/libraries/ArduinoIoTCloud/src/ota/interface/OTAInterfaceDefault.cpp: In member function 'virtual void OTADefaultCloudProcessInterface::reset()':
~/Development/Arduino/libraries/ArduinoIoTCloud/src/ota/interface/OTAInterfaceDefault.cpp:226:12: warning: deleting object of polymorphic class type 'HttpClient' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
     delete http_client;
            ^~~~~~~~~~~