10000 virtual destructor warning · Issue #47 · bblanchon/ArduinoJson · GitHub
[go: up one dir, main page]

Skip to content
virtual destructor warning #47
@Slechtvalk

Description

@Slechtvalk

When compiling for STM32 Cortex-M4 I got this warning 👎:

ArduinoJson/src/Internals/../../include/ArduinoJson/Internals/../JsonBuffer.hpp:21:7: error: 'class ArduinoJson::JsonBuffer' has virtual functions and accessible non-virtual destructor [-Werror=non-virtual-dtor] class JsonBuffer { ^ cc1plus: all warnings being treated as errors
I saw the comment about adding malloc() to Arduino code. This is quite true, but leaving a destructor not virtual with virtual functions is considered very sloppy programming.

😄 I propose you add #ifndef ARDUINO around the virtual destructor. On my STM32 those 500 bytes are of no concern and I would like to get rid of the compiler warning, which translates into an error in my build.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0