GCC - 成员应在成员初始化列表中初始化
我不断收到 GCC 的警告,但我没有以任何方式为此项目启用它。我尝试创建一个新项目(我在 Ubuntu 中运行 Code::Blocks IDE),但仍然收到警告。请帮忙?
编辑:手动调用 GCC 不会导致此问题,但通过 Code::Blocks 调用它(禁用所有警告)确实会导致此问题。由此,我猜测这是一个 Code::Blocks 错误。
编辑2:已修复。结果 Code::Blocks 具有全局编译器标志,无法在特定项目内覆盖,这导致了错误。
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?
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.
Edit2: Fixed. Turns out Code::Blocks has global compiler flags which can't be overridden inside specific projects, and this was causing the error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
然后按照警告的指示去做。很可能它的存在是有原因的。
您始终可以忽略警告。此外,您很可能将一个参数传递给 gcc 来启用该警告。
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.