When I build UnzipKit in Xcode 7 beta 4, I'm getting a compiler warning in MiniZip's ioapi.h
file. For example:
.../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 compile it with -Wno-everything
like so:
However, there is no "Compiler Flags" setting available for the headers:
How can I silence the warning without modifying the source file? I'd rather not modify it, as it's an external dependency. I also don't want to turn it on for the whole project, because it's a useful warning for my own code.
If you want to disable all warnings, you can pass the -suppress-warnings flag (or turn on "Suppress Warnings" under "Swift Compiler - Warning Policies" in Xcode build settings).
File→Open Quickly: Command-D Pops up a panel where you can type a file name. This is most frequently used for opening header files from the Cocoa frameworks. You can type in a name without an extension and Xcode will first try to find an implementation file and if it can't find one will look for an interface file.
I found my answer using this one: https://stackoverflow.com/a/7535436/2148757
I imagine your code would look like this:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#import "ioapi.h" //Hide a warning in this header because we don't want to change our dependencies
#pragma clang diagnostic pop
Edit: I did not need to import the header file in our project where this worked, but I imported it anyway into the PrefixHeader.pch file to remove the warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With