gcc4.6 构建失败,但 gcc4.5 构建失败

发布于 2025-01-07 17:27:09 字数 157 浏览 5 评论 0原文

我们在构建代码时使用 -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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伪心 2025-01-14 17:27:09

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文