24

Can someone help me to turn off warnings in Xcode 4 that I'm getting from subprojects?

I have three subprojects, with a lot of warnings. The subprojects are provide by my customer's R&D studio. I would like to turn off the warnings there, to put all my efforts and attention on warnings in my own code.

This the xcode warning counter now

Is this possibile in Xcode 4?

jscs
  • 63,694
  • 13
  • 151
  • 195
Luca Bartoletti
  • 2,435
  • 1
  • 24
  • 46

3 Answers3

58

If you're using Xcode 4.2 or later, you can use LLVM compiler setting Inhibit All Warnings in Warning Polices for every subproject you have:

enter image description here

Johnnywho
  • 5,541
  • 2
  • 27
  • 20
  • 16
    In my case, the subproject is a git submodule. It's owned by 3rd party and is constantly updating, so I'd really like to avoid modifying any of its files. Is there any way to do this in the main-project level? Thanks. – Joseph Lin Oct 10 '12 at 19:05
  • 2
    Yes, if you create a private cocoapods repository for the 3rd party project you can include it with a pod file and turn off the warnings with the inhibit_all_warnings! option. You can find more infos here http://cocoapods.org – Luca Bartoletti Jul 24 '14 at 09:03
2

A partial solution only:

If your subprojects build libraries or bundles that do not have to recompile at every run, you can activate the "recent filer" (see figure, blue clock). Then, only warnings and errors from the last compiler run are displayed.

recent filter

Matthias
  • 8,018
  • 2
  • 27
  • 53
  • 2
    I've been having this problem, and this solution doesn't work for me: the subproject warnings are still displayed and furthermore it makes navigating the project more confusing. – Vic Smith Aug 07 '12 at 08:11
  • @VicSmith: I guess, your subprojects do not generat libraries or bundles; thus they may compiled every time. What you can do is to sort the issues "By File" and collapse your subprojects in the issue inspector. Then you get only one issue sign for each subproject. – Matthias Aug 07 '12 at 09:05
  • Thank you @Matthias but this is not the solution i'm looking for. – Luca Bartoletti Aug 08 '12 at 07:28
0

If the library isn't too big, You could disable warnings on a per-file basis using

#pragma GCC diagnostic ignored "-Wwarning-flag"
Shai Mishali
  • 9,224
  • 4
  • 56
  • 83
  • One of the library is a 15 years old lib with 1000+ source code files :(. And i want disable warning only when i'm compiling the source from the app project. Not when their working on the lib – Luca Bartoletti Aug 09 '12 at 10:42
  • 1
    Sorry :) Are most errors of a specific kind of they're just general errors ? What about compiling them in a separate project as static libraries, and then including the libraries without the actual source ? – Shai Mishali Aug 09 '12 at 10:43
  • Because i need, as requirement from the customer, to have these libs as subprojects in xcode – Luca Bartoletti Aug 09 '12 at 10:45
  • 2
    OK, i get that, But just for the development time you could pre-compile these libraries, just to avoid having the warnings while working. When delivering your code to the client, remove your libraries, put back the source code as subprojects and deliver it to the client. – Shai Mishali Aug 09 '12 at 10:48
  • During the development process i need to share the project with the client. From that my original question: "There is a way to turn off warning in xcode from subprojects?". Any solution that remove the subprojects from the context is appreciate but is not the solution i'm looking for. – Luca Bartoletti Aug 09 '12 at 10:55