如何禁用缩小转换警告? [英] How to disable narrowing conversion warnings?
问题描述
我使用 -Wall
并更新到新的gcc我有很多 warning:缩小转换
。我想禁用它们,但保留所有其他警告(理想情况下)。
我找不到任何关于缩小
在 http://gcc.gnu.org/onlinedocs/gcc/Warning-Options。 html
如何禁用缩小转换警告?
是否有可能?
-
我需要禁用警告,而不是在源代码中修复它们。
-
盲目
-Wno-conversion
没有帮助。 正如gx_所说的,在命令行中加入
-Wno-narrowing
应该忽略这些错误。
升级到C ++ 0x时遇到此问题。
I use -Wall
and updating to new gcc I have got a lot of warning: narrowing conversion
. I want to disable them, but leave all other warnings untouched (ideally).
I can find nothing about narrowing
in http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
How to disable narrowing conversion warnings? Is it possible at all?
P.S.
I need to Disable warnings, not fix them in the source code.
Blind
-Wno-conversion
doesn't help.
As gx_ said, adding -Wno-narrowing
to your command line should ignore those errors. Encountered this myself when upgrading to C++0x.
这篇关于如何禁用缩小转换警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!