23

E.g. '@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.

I am running Xcode 8.2.1.

Ilias Karim
  • 3,855
  • 1
  • 31
  • 48

2 Answers2

49

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.

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

John
  • 506
  • 5
  • 4
  • 7
    This doesn't silence third party documentation in imported SDKs. I have an entire menu of third party documentation warnings that have nothing to do with my project so I'd love to find a way to silence these as well. Any ideas? Thanks. – Edison Aug 14 '17 at 02:17
  • @tymac Use same solution for Pods.project – Aznix Oct 31 '17 at 16:05
  • 1
    @Aznix what do you mean by "Pods.project"? – Konchog Apr 05 '18 at 07:53
  • 2
    I used #pragma clang diagnostic ignored "-Wdocumentation" – Konchog Apr 05 '18 at 14:32
5

This solved it for me, surpassing the warnings only in the third party library headers. Just wrap the problematic header #includes with these 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 Konchog and Vladimir Grigorov’s super helpful answer here.

Craig Reynolds
  • 555
  • 5
  • 15