Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pod spec lint not validating -Wno-* compiler flags #2210

Closed
mxcl opened this issue May 30, 2014 · 4 comments
Closed

pod spec lint not validating -Wno-* compiler flags #2210

mxcl opened this issue May 30, 2014 · 4 comments
Labels
t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future.

Comments

@mxcl
Copy link

mxcl commented May 30, 2014

Referring to this Twitter conversation and this screenshot:

screen shot 2014-05-30 at 1 18 40 pm

In this case not preventing the warning would result in ~400 warnings for the end user. My choices were using the warning or putting every method in YOLOKit into a separate category, which was doable, but would make adding new methods in the future tedious, and something I wanted to avoid. The warning in this case was irrelevant for the library itself, and I only wanted the warning to apply when compiling YOLOKit itself, not outside of it.

In the end I worked around it with a clang pragma which I then include from every .m.

IMO as long as the warning flags don't propagate to the main project, CocoaPods could make this acceptable but maybe continue to refuse -w.

The specific flag here is -Wno-incomplete-implementation and I applied it as I have a single category (YOLO) for the library, but I split all the implementations across many files in order to make every method its own module. Clang would then warn in every file that the implementations were not complete, but they were, just not in the compilation unit.

@fabiopelosin
Copy link
Member

Some context:

  • We are trusting Xcode default configuration for the warnings as a sensible choice.
  • We decided to keep the warnings visible for the betterment of the ecosystem and to encourage the submissions of patches aimed at addressing them. The same logic applies is the reason why we are printing a warning if they are disabled.
  • Clang pragmas are a great way to deal with edge cases.

@fabiopelosin
Copy link
Member

@CocoaPods/core ping

@fabiopelosin
Copy link
Member

The consensus appears to be that pragma directives should be used in cases like this.

@NSExceptional
Copy link

That's an interesting conclusion to come to. Shouldn't it be up to the author, whose warnings flags will end up being used to compile their source anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t3:discussion These are issues that can be non-issues, and encompass best practices, or plans for the future.
Projects
None yet
Development

No branches or pull requests

4 participants