From 777beb4f267fd5d809ce8c13ed4dea942215e020 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 26 Jul 2012 17:30:12 +0000 Subject: [Author: dmaclach] Turn off warnings on gcc. Leave them on on clang. R=thomasvl DELTA=32 (30 added, 2 deleted, 0 changed) --- Foundation/GTMLogger.m | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Foundation/GTMLogger.m') diff --git a/Foundation/GTMLogger.m b/Foundation/GTMLogger.m index 0263aa1..4b40747 100644 --- a/Foundation/GTMLogger.m +++ b/Foundation/GTMLogger.m @@ -24,6 +24,16 @@ #import +#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) +// Some versions of GCC (4.2 and below AFAIK) aren't great about supporting +// -Wmissing-format-attribute +// when the function is anything more complex than foo(NSString *fmt, ...). +// You see the error inside the function when you turn ... into va_args and +// attempt to call another function (like vsprintf for example). +// So we just shut off the warning for this file. We reenable it at the end. +#pragma GCC diagnostic ignored "-Wmissing-format-attribute" +#endif // !__clang__ + // Reference to the shared GTMLogger instance. This is not a singleton, it's // just an easy reference to one shared instance. static GTMLogger *gSharedLogger = nil; @@ -265,7 +275,6 @@ static GTMLogger *gSharedLogger = nil; @end // GTMLogger - @implementation GTMLogger (GTMLoggerMacroHelpers) - (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... { @@ -298,7 +307,6 @@ static GTMLogger *gSharedLogger = nil; @end // GTMLoggerMacroHelpers - @implementation GTMLogger (PrivateMethods) - (void)logInternalFunc:(const char *)func @@ -596,3 +604,9 @@ static BOOL IsVerboseLoggingEnabled(void) { } @end // GTMLogMaximumLevelFilter + +#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) +// See comment at top of file. +#pragma GCC diagnostic error "-Wmissing-format-attribute" +#endif // !__clang__ + -- cgit v1.2.3