在 Xcode 中消除“文档问题”警告?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42991455/
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 09:51:14  来源:igfitidea点击:

Silencing "Documentation issue" warnings in Xcode?

xcodedocumentationwarnings

提问by Ilias Karim

E.g. '@param' command used in a comment that is not attached to a function declaration

例如 '@param' command used in a comment that is not attached to a function declaration

This warning is valid, however, I am compiling 3rd party code and wish to not have to alter the original source.

这个警告是有效的,但是,我正在编译 3rd 方代码并且希望不必更改原始源代码。

I am running Xcode 8.2.1.

我正在运行 Xcode 8.2.1。

回答by John

I was able to suppress these warnings by going to

我能够通过去抑制这些警告

Project -> Build Settings -> Apple LLVM 8.1 - Warnings - All Languages,and switching the "Documentation Comments" to No.

Project -> Build Settings -> Apple LLVM 8.1 - Warnings - All Languages,并将“文档注释”切换为No

(To find the setting, I typed "Documentation" into the search box under Build Settings.)

(要查找设置,我在“构建设置”下的搜索框中键入“文档”。)

回答by Craig Reynolds

This solved it for me, surpassing the warnings onlyin the third party library headers. Just wrap the problematic header #includeswith these pragmas:

这为我解决了这个问题,超过了在第三方库头文件中的警告。只需#includes用这些pragmas包装有问题的标头:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#pragma clang diagnostic pop

this is a combination of a hint from Konchogand Vladimir Grigorov's super helpful answer here.

这是Konchog和 Vladimir Grigorov在这里给出的超级有用答案的提示的组合 。