aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMLogger.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-07-26 17:30:12 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-07-26 17:30:12 +0000
commit777beb4f267fd5d809ce8c13ed4dea942215e020 (patch)
tree1461c9d05fae280e9f9786254c7a4d28fd01de0f /Foundation/GTMLogger.m
parent222096014fbfbe56700c98ec99cffbf87fc6ef33 (diff)
[Author: dmaclach]
Turn off warnings on gcc. Leave them on on clang. R=thomasvl DELTA=32 (30 added, 2 deleted, 0 changed)
Diffstat (limited to 'Foundation/GTMLogger.m')
-rw-r--r--Foundation/GTMLogger.m18
1 files changed, 16 insertions, 2 deletions
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 <pthread.h>
+#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__
+