gcc4.6 构建失败,但 gcc4.5 构建失败
我们在构建代码时使用 -Werror=unused-but-set-variable gcc 编译器选项。显然,使用 gcc4.5 的人可以构建它,“即使”存在已设置但随后未使用的变量。但我使用 gcc4.6 无法构建代码。 gcc4.5 中是否未实现该特定 gcc 选项?
提前致谢
we here use -Werror=unused-but-set-variable
gcc compiler option while building our code. Apparently the people using gcc4.5 can build it "even though" there are variables which are set but not used afterwards. But I using gcc4.6 cannot build the code. Is that particular gcc option not implemented in gcc4.5?
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GCC 4.6 警告相对于 GCC 4.5 生成的警告进行了改进。但是您可以只使用
-Wunused-but-set-variable
来获取警告,而不是错误,更重要的是纠正您的源代码(也许通过删除那个无用的变量)。The GCC 4.6 warnings are improved w.r.t. to those produced by GCC 4.5. But you could just use
-Wunused-but-set-variable
to get warnings, not errors, and more importantly correct your source code (perhaps by removing that useless variable).