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

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

问题描述

我很好奇,如果有一个选项禁用gcc警告一个参数不是有效的正在编译的语言。



例如:

  cc1:warning: Wno-deprecated对C ++ / Java / ObjC ++有效,但不适用于C 

我们在整个构建过程中全球决定的警告。
我们有C / C ++代码和警告,当试图找到实际警告时真的很烦人。



有任何建议吗?

解决方案

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



有完全不同语言版本的相同选项似乎有点奇怪 - 我会有不同的选项定义为makefile宏,并适用于不同的目标。

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

Ex:

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

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.

Any suggestions?

解决方案

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.

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天全站免登陆