microsoft / onnxruntime-extensions

onnxruntime-extensions: A specialized pre- and post- processing library for ONNX Runtime
MIT License
295 stars 80 forks source link

Fix warnings around usage of virtual. #713

Closed skottmckay closed 1 month ago

skottmckay commented 1 month ago

Fix warnings like this:

D:/Android/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/memory:2427:5: warning: delete called on 'Ort::Custom::IStringTensorStorage<std::basic_string_view<char>>' that is abstract but has non-virtual destructor [-Wdelete-abstract-non-virtual-dtor]
    delete __ptr;
    ^
...
D:/Android/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/memory:2427:5: warning: delete called on 'Ort::Custom::ITensorStorage' that is abstract but has non-virtual destructor [-Wdelete-abstract-non-virtual-dtor]
    delete __ptr;

Cleanup virtual/override usage. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override https://github.com/isocpp/CppCoreGuidelines/pull/1448

skottmckay commented 1 month ago

Possibly it's just a case of setting 'warnings as errors' to detect.