Suppress warning: removing "void *" - undefined

I know what this warning is and I need to suppress this warning. Is there a way to use pragma or compiler options to suppress this warning?

+3


source to share


2 answers


Better to change your code to avoid this warning rather than suppress it! If handled incorrectly, it can lead to surprises that are much more difficult to find.



[Note. To answer your question, which should be taken with a grain of salt, you can use free()

instead delete

as it converts any pointer to void*

before freeing it. Make sure the destructors are called correctly before doing this.]

+3


source


Just add it before deleting it.



delete[] (char*)item_to_del;

      

0


source







All Articles