如何禁用缩小转换警告? [英] How to disable narrowing conversion warnings?

查看:250
本文介绍了如何禁用缩小转换警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 -Wall 并更新到新的gcc我有很多 warning:缩小转换。我想禁用它们,但保留所有其他警告(理想情况下)。



我找不到任何关于缩小 http://gcc.gnu.org/onlinedocs/gcc/Warning-Options。 html



如何禁用缩小转换警告?
是否有可能?


  1. 我需要禁用警告,而不是在源代码中修复它们。


  2. 盲目 -Wno-conversion 没有帮助。

  3. 正如gx_所说的,在命令行中加入 -Wno-narrowing 应该忽略这些错误。


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.

  1. I need to Disable warnings, not fix them in the source code.

  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆