Xcode: suppress all warnings for all external libraries

To disable the compiler warning, go to ProjectTargetBuild Settings and add a flag

-w

for a specific file. This flag disables all warnings for the file.

But sometimes this flag does not work .

For example, when I run the test, I get warnings for the external Nimble library (all these files are marked with the -w flag):

... / pods / Artful / Sources / Artful / Matchers / MatcherProtocols.swift: 15: 11: "Matcher" is deprecated: use Predicate instead ... / pods / Artful / Sources / Artful / Matchers / Predicate.swift: 170: 22: 'Matcher' deprecated: use Predicate instead ... /Pods/Nimble/Sources/Nimble/Matchers/AllPass.swift: 22: 27: 'Matcher' deprecated: use Predicate instead ... / Pods / Nimble / Sources / Nimble / Matchers / AllPass.swift: 76: 21: the "generator" variable has never mutated; consider switching to "let" permanent ... / pods / Artful / Sources / Artful / Matchers / AsyncMatcherWrapper.swift: 41:14: "Matcher" is deprecated: use Predicate instead

What am I doing wrong and how to get rid of warnings for external libraries that I don’t affect?

+4
2

, cocoapods. Cocoapods , pod install. , podfile, :

# example to ignore all warnings from all pods
inhibit_all_warnings!

# example to ignore warnings from a specific pod
pod 'Alamofire', :inhibit_warnings => true

. , .

+5

cocoapods . inhibit_all_warnings! podfile, , cocoapods.

inhibit_all_warnings! . .

+2

Source: https://habr.com/ru/post/1686363/


All Articles