GCC - 成员应在成员初始化列表中初始化

时间:2021-01-16 19:31:32

I keep getting this warning with GCC, but I didn't enable it in any way for this project. I tried creating a new project (I'm running the Code::Blocks IDE in Ubuntu), and I'm still getting the warning. Help, please?

我不断向GCC发出此警告,但我没有以任何方式启用此项目。我尝试创建一个新项目(我在Ubuntu中运行Code :: Blocks IDE),我仍然收到警告。请帮忙?

Edit: Invoking GCC manually does not cause this issue, but invoking it through Code::Blocks (with all warnings disabled) does cause it. From this, I'm guessing it's a Code::Blocks bug.

编辑:手动调用GCC不会导致此问题,但通过Code :: Blocks调用它(禁用所有警告)确实会导致它。从这里,我猜它是一个Code :: Blocks错误。

Edit2: Fixed. Turns out Code::Blocks has global compiler flags which can't be overridden inside specific projects, and this was causing the error.

Edit2:固定。结果是Code :: Blocks具有全局编译器标志,这些标志不能在特定项目中被覆盖,这导致了错误。

1 个解决方案

#1


0  

Then do what the warning tells you to do. Most likely it is there with a reason.

然后执行警告告诉您的操作。最有可能是因为有原因。

You can always ignore warnings. Also, you are most likely passing a parameter to the gcc that enables that warning.

您始终可以忽略警告。此外,您最有可能将参数传递给启用该警告的gcc。

#1


0  

Then do what the warning tells you to do. Most likely it is there with a reason.

然后执行警告告诉您的操作。最有可能是因为有原因。

You can always ignore warnings. Also, you are most likely passing a parameter to the gcc that enables that warning.

您始终可以忽略警告。此外,您最有可能将参数传递给启用该警告的gcc。