Context
I read Clang's "Controlling Diagnostics via Pragmas" section about turning off particular warnings. It works well in general for all warnings except for -Wgnu-zero-variadic-macro-arguments.
The code is:
MyHeader.hpp
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#import "header generating -Wgnu-zero-variadic-macro-arguments warning"
#pragma clang diagnostic pop
Problem
Clang generates -Wgnu-zero-variadic-macro-arguments warnings while compiling translation units importing MyHeader.hpp.
Env
Clang Version: Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix
OS: Mac OS X 10.9.5
This seems to be working in Xcode 6.4 (6E35b). The pragma suppresses the warning now.
I have
-Weverything
in build settings. Without the diagnostic ignore I definitely get the warning:Output from Terminal to match your Env section:
Using the following code:
In which Macros.h contains: