标准库警告正常吗?

发布于 2024-09-28 02:46:24 字数 530 浏览 0 评论 0原文

我目前正在学习视觉工作室的方法。如果我设置了/Wall,尽管我的应用程序可以正常编译,但我会收到大量看似不健康的警告消息。

这是正常的吗?更改错误级别将停止消息。看起来好像它们都与 C++ STL 或其头文件相关 - 是一样的吗?

如果我使用 code::blocks (GCC) 构建程序,则尽管警告级别相同,但不会报告任何错误。

这是怎么回事?

更新: Visual Studio /Wall 输出:http://pastebin.com/FBGLd2Hb

Visual Studio < code>/W4 输出: http://pastebin.com/YuWKVS9G

代码实际上来自 Wrox专业C++。 我对“警告”一词的使用可能是错误的?

I'm learning my way around visual studio at the moment. If I've turned set /Wall I'll be greeted with a seemingly unhealthy amount of warning messages although my application will compile just fine.

Is this normal? Changing the error level will stop the messages. It looks as if they are all related to the C++ STL or its header files - same thing?

If I build the program using code::blocks (GCC) then no errors are reported despite the same warning level.

What's going on here?

update:
visual studio /Wall output: http://pastebin.com/FBGLd2Hb

visual studio /W4 output: http://pastebin.com/YuWKVS9G

The code is actually from Wrox Professional C++.
I could be wrong about my usage of the word warnings?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

一杯敬自由 2024-10-05 02:46:24

使用 g++ -Wall 不会打开所有警告,而只是打开一个实用的子集。我怀疑 MSVC /Wall 会打开比实际更多的警告。 MSVC 对警告非常热心。

对于 MSVC,请使用 /W4 以获得高警告级别。

您必须关闭 MSVC sillywarnings;您可以使用我的 anti-MSVC-sillywarnings 标头

干杯&呵呵,,

With g++ -Wall does not turn on all warnings, just a practical subset. I suspect that with MSVC /Wall turns on more warnings than is practical. MSVC is very enthusiastic about warnings.

With MSVC use /W4 for high warning level.

You'll have to turn off MSVC sillywarnings; you can use my anti-MSVC-sillywarnings header for that.

Cheers & hth.,

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