Is there any way to prevent "deferred conversion from string constant to 'char*'" from appearing on GCC?

Asked 2 years ago, Updated 2 years ago, 103 views

I recently upgraded to gcc4.3, and the following warning appears after that.

I think this happened by writing char* where you need to write const char*.

My code is really long. (Almost 500 files) Cannot change to const one by one.

But I have to write -error If there is warning, it cannot be compiled. Is there a good way?

`warning: deprecated conversion from string constant to ‘char*’

string c++ gcc warning const-char

2022-09-22 11:31

1 Answers

Try the following two methods


2022-09-22 11:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.