禁用不兼容的选项GCC警告 [英] Disable gcc warning for incompatible options

查看:194
本文介绍了禁用不兼容的选项GCC警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇,如果有禁用有关被编译的语言不是有效的参数GCC警告选项。

I'm curious if there is an option to disable gcc warnings about a parameter not being valid for the language being compiled.

例如:

cc1: warning: command line option "-Wno-deprecated" is valid for C++/Java/ObjC++ but not for C

我们的构建系统,通过我们在全球各地构建决定了警告。
我们有C / C ++ code,并试图找到实际的警告时的警告得到真正的讨厌。

Our build system passes the warnings we have decided on globally across a build. We have both C/C++ code and the warnings get real annoying when trying to find actual warnings.

有什么建议?

推荐答案

在我看来,如果有这样的选择,就必须进一步的选项关闭警告有关该选项,等等无限。所以我怀疑没有。

It seems to me that if there were such an option, there would have to be a further option to turn off warnings about that option, and so on infinitely. So I suspect there isn't.

有同样的选项,构建完全不同的语言似乎有点奇怪反正 - 我会定义为makefile宏和不同目标的适当使用不同的选项

Having the same options for builds of completely different languages seems a bit odd anyway - I would have different options defined as makefile macros and used appropriately for different targets.

这篇关于禁用不兼容的选项GCC警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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