xcode 关闭来自子项目的警告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11841479/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:09:31  来源:igfitidea点击:

Turn off warnings coming from subprojects

xcodexcode4compiler-warnings

提问by Luca Bartoletti

Can someone help me to turn off warnings in Xcode 4 that I'm getting from subprojects?

有人可以帮助我关闭 Xcode 4 中从子项目中收到的警告吗?

I have three subprojects, with a lot of warnings. The subprojects are provide by my customer's R&D studio. I would like to turn off the warnings there, to put all my efforts and attention on warnings in my own code.

我有三个子项目,有很多警告。子项目由我客户的研发工作室提供。我想关闭那里的警告,把我所有的努力和注意力放在我自己代码中的警告上。

This the xcode warning counter now

这是现在的 xcode 警告计数器

Is this possibile in Xcode 4?

这在 Xcode 4 中是可能的吗?

回答by Johnnywho

If you're using Xcode 4.2 or later, you can use LLVM compiler setting Inhibit All Warningsin Warning Policesfor every subproject you have:

如果您使用的Xcode 4.2或更高版本,可以使用LLVM编译器设置Inhibit All WarningsWarning Polices你有充分的子项目:

enter image description here

在此处输入图片说明

回答by Matthias

A partial solution only:

仅部分解决方案:

If your subprojects build libraries or bundles that do not have to recompile at every run, you can activate the "recent filer" (see figure, blue clock). Then, only warnings and errors from the last compiler run are displayed.

如果您的子项目构建的库或包无需在每次运行时重新编译,您可以激活“最近的文件管理器”(见图,蓝色时钟)。然后,仅显示来自上次编译器运行的警告和错误。

recent filter

最近过滤器

回答by Shai Mishali

If the library isn't too big, You could disable warnings on a per-file basis using

如果库不是太大,您可以使用每个文件禁用警告

#pragma GCC diagnostic ignored "-Wwarning-flag"