How can -Wgnu-zero-variadic-macro-arguments warning be turned off with Clang? -



How can -Wgnu-zero-variadic-macro-arguments warning be turned off with Clang? -

context

i read clang's "controlling diagnostics via pragmas" section turning off particular warnings. works in general warnings except -wgnu-zero-variadic-macro-arguments.

the code is:

myheader.hpp

#pragma clang diagnostic force #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 working in xcode 6.4 (6e35b). pragma suppresses warning now.

i have -weverything in build settings. without diagnostic ignore warning:

token pasting of ',' , __va_args__ gnu extension

output terminal match evn section:

$ clang --version apple llvm version 6.1.0 (clang-602.0.53) (based on llvm 3.6.0svn) target: x86_64-apple-darwin14.4.0 thread model: posix

using next code:

#define debug #pragma clang diagnostic force #pragma clang diagnostic ignored "-wgnu-zero-variadic-macro-arguments" #import "macros.h" #pragma clang diagnostic pop

in macros.h contains:

#ifdef debug #define asslog(condition, message, ...) nsassert(condition, message, ##__va_args__) #else #define asslog(condition, message, ...) if (!condition) nslog((@"%@ [line %d] " message), [nsstring stringwithutf8string:__pretty_function__], __line__, ##__va_args__) #endif

clang warnings suppress-warnings

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -