0

I'm using Xcode 6.3.2 to compile my application, which depends on JsonCpp. I would like to suppress the large number of warnings that this library generates so I've specified the path to the JsonCpp header using -isystem as advised in the Clang User Manual

Controlling Diagnostics in System Headers

Warnings are suppressed when they occur in system headers. By default, an included file is treated as a system header if it is found in an include path specified by -isystem, but this can be overridden in several ways.

However, this does not seem to be working as the warnings are still generated. E.g.

json.cpp:352:44: Implicit conversion changes signedness: 'long' to 'size_t' (aka 'unsigned long')

Is there something else I need to set/unset?

ksl
  • 4,519
  • 11
  • 65
  • 106
  • What warnings and why doesn't disabling specific warnings in the *Build Settings* affect every warning the compiler sees, regardless of where it comes from (i.e. why does it matter if it comes from a "system header")? – trojanfoe Mar 29 '16 at 14:07
  • I don't want to disable warnings in my application code. Using `-isystem` to specify the path to the header treats it as a system header and suppresses any warnings. Or it should. – ksl Mar 29 '16 at 14:10
  • OK that makes sense, however you are getting an error in `json.cpp` but that's not a system header is it. If you are compiling these source files then `-isystem` will have no effect. I think you should be suppressing warnings in specific source files. Does [this](http://stackoverflow.com/questions/6921884/in-xcode-how-to-suppress-all-warnings-in-specific-source-files) work in Xcode still? – trojanfoe Mar 29 '16 at 14:14
  • Xcode should treat it as a system header if the path to it is defined by `isystem`. – ksl Mar 29 '16 at 14:59
  • maybe the keyword there is *included* file. The file name does not look like it's an included file, but a normal source file being compiled. – planetmaker Mar 29 '16 at 15:19
  • @planetmaker I see your point. Subtle. – ksl Mar 30 '16 at 08:21

0 Answers0