inhibit_all_warnings! does not inhibit documentation warnings (-Wdocumentation)
Do you have any idea why CLANG_WARN_DOCUMENTATION_COMMENTS would not be disabled by default when setting GCC_WARN_INHIBIT_ALL_WARNINGS to YES? And are there more warnings that are not included in GCC_WARN_INHIBIT_ALL_WARNINGS? Or are all warnings prefixed with CLANG_ excluded from GCC_WARN_INHIBIT_ALL_WARNINGS?
I haven't use -Wdocumentation yet, but have read the latest iOS dev weekly which points to an article which points to Clang 3.2 release notes and it says:
Documentation comment support
Clang now supports documentation comments written in a Doxygen-like syntax. Clang parses the comments and can detect syntactic and semantic errors in comments. These warnings are off by default. Pass -Wdocumentation flag to enable warnings about documentation comments.
So looks like -Wdocumentation should be off by default...
This happens because of the mechanics of #import.
When you #import a header, the Clang preprocessor ends up copy-pasting the contents of the header into your file. As a result, when Clang is compiling your project, it sees the headers from the Pods as _part of your project_. As a result, documentation errors in Pod headers are warnings in the _host project_, not the Pods project.
Cocoapods should only hide errors from the Pods project, so there's not much we can do to fix this.
You can work around this issue by doing this:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#import <YourHeader.h>
#pragma clang diagnostic pop
(edited, thanks to @revolter for the typo find!)
@tangphillip So obvious in hindsight… :) Thanks so much for taking the time! :+1:
Is this the same reason the "missing newline at end of file" warning isn't suppressed?
@lancep Yep! You can fix that one by using "-Wnewline-eof" instead of "-Wdocumentation" in the code snippet above.
@lancep Or simply disable these warnings completely in your app target.
WoW! Thanks @tangphillip !
Isn't is #pragma clang diagnostic pop? Or is it the same thing?
Most helpful comment
This happens because of the mechanics of
#import.When you
#importa header, the Clang preprocessor ends up copy-pasting the contents of the header into your file. As a result, when Clang is compiling your project, it sees the headers from the Pods as _part of your project_. As a result, documentation errors in Pod headers are warnings in the _host project_, not the Pods project.Cocoapods should only hide errors from the Pods project, so there's not much we can do to fix this.
You can work around this issue by doing this:
(edited, thanks to @revolter for the typo find!)