I know what is this warning and need to suppress this warning. Is there any way using pragma or compiler options are available to suppress this warning?
Better to change the code to avoid this warning rather than suppressing it! If not handled correctly, it may cause runtime surprises which will be much harder to find.
[Note: To answer your question, which should be taken with a grain of salt, you may use free()
instead of delete
, as it converts any pointer to void*
before deallocating it. Make sure that the destructors are called correctly before it.]