Skip to content

-Wdelete-non-virtual-dtor compiler warnings #492

Open
arduino/ArduinoCore-API
#218
@zfields

Description

@zfields

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;
            ^~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions