在 Xcode 中屏蔽 "Documentation issue" 个警告?

Silencing "Documentation issue" warnings in Xcode?

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

此警告有效,但是,我正在编译第 3 方代码并希望不必更改原始源代码。

我是运行Xcode8.2.1.

我可以通过转到

来抑制这些警告

项目 -> 构建设置 -> Apple LLVM 8.1 - 警告 - 所有语言, 并将 "Documentation Comments" 切换为 No.

(为了找到设置,我在构建设置下的搜索框中输入了 "Documentation"。)

这为我解决了,超越了第三方库 header 中的警告 。只需用这些 pragmas:

包装有问题的 header #includes
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#pragma clang diagnostic pop

这是来自 Konchog and Vladimir Grigorov’s super helpful answer here.