How to suppress file header warnings from an Xcode project

When I create UnzipKit in Xcode 7 beta 4, I get a compiler warning in the MiniZip ioapi.h file. For instance:

 .../ioapi.h:22:9: warning: macro name is a reserved identifier [-Wreserved-id-macro] #define _ZLIBIOAPI64_H 

ioapi.c has many of its own warnings, so I will compile it with -Wno-everything like this:

Compilation source assembly phase

However, there are no compiler options available for headers:

Header Build Phase

How to disable a warning without changing the source file? I would prefer not to change it, since this is an external dependency. I also do not want to include it for the whole project, because this is a useful warning for my own code.

+4
source share
1 answer

I found my answer using this: fooobar.com/questions/18772 / ...

I assume your code will look like this:

 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wno-everything" #import "ioapi.h" //Hide a warning in this header because we don't want to change our dependencies #pragma clang diagnostic pop 

Edit: I didn't need to import the header file into our project where it worked, but I still imported it into the PrefixHeader.pch file to remove the warning.

+3
source

All Articles