In Xcode, how to suppress all warnings in specific source files?

Bobrovsky picture Bobrovsky · Aug 3, 2011 · Viewed 50k times · Source

In my application I use 3rd party code that triggers some warnings. I reviewed them and they can be safely ignored.

Now I want to "mark" a file somehow, so Xcode won't show any warnings for the code in that file.

How should I do that?

Answer

Jon Reid picture Jon Reid · Aug 3, 2011

Select your target and show Build Phases. Then enter the name of the file in the search box, and you should see it listed in the Compile Sources phase. Double-click in the Compiler Flags column for that file and enter -w to turn off all warnings for that file.