Revision: 556
Author: gtm.daemon
Date: Thu Jul 26 10:30:12 2012
Log: [Author: dmaclach]
Turn off warnings on gcc. Leave them on on clang.
R=thomasvl
DELTA=32 (30 added, 2 deleted, 0 changed)
http://code.google.com/p/google-toolbox-for-mac/source/detail?r=556
Modified:
/trunk/Foundation/GTMLogger+ASL.m
/trunk/Foundation/GTMLogger.m
=======================================
--- /trunk/Foundation/GTMLogger+ASL.m Thu May 26 13:30:19 2011
+++ /trunk/Foundation/GTMLogger+ASL.m Thu Jul 26 10:30:12 2012
@@ -106,6 +106,16 @@
@implementation GTMLogASLFormatter
+#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 function.
+#pragma GCC diagnostic ignored "-Wmissing-format-attribute"
+#endif // !__clang__
+
- (NSString *)stringForFunc:(NSString *)func
withFormat:(NSString *)fmt
valist:(va_list)args
@@ -115,6 +125,10 @@
// |super| has guard for nil |fmt| and |args|
[super stringForFunc:func withFormat:fmt valist:args
level:level]];
}
+
+#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42)
+#pragma GCC diagnostic error "-Wmissing-format-attribute"
+#endif // !__clang__
@end // GTMLogASLFormatter
=======================================
--- /trunk/Foundation/GTMLogger.m Fri Apr 20 11:30:11 2012
+++ /trunk/Foundation/GTMLogger.m Thu Jul 26 10:30:12 2012
@@ -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 @@
@end // GTMLogger
-
@implementation GTMLogger (GTMLoggerMacroHelpers)
- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... {
@@ -298,7 +307,6 @@
@end // GTMLoggerMacroHelpers
-
@implementation GTMLogger (PrivateMethods)
- (void)logInternalFunc:(const char *)func
@@ -596,3 +604,9 @@
}
@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__
+