From c2c9021271efb4bac13da89bc9073bda7780f029 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 26 Jul 2012 21:00:23 +0000 Subject: [Author: dmaclach] Fix up final GTM issues that I know of for format. TBR=thomasvl DELTA=16 (16 added, 0 deleted, 0 changed) --- Foundation/GTMLoggerTest.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Foundation/GTMLoggerTest.m') diff --git a/Foundation/GTMLoggerTest.m b/Foundation/GTMLoggerTest.m index c48bf65..1b421c0 100644 --- a/Foundation/GTMLoggerTest.m +++ b/Foundation/GTMLoggerTest.m @@ -58,6 +58,17 @@ @interface DumbFormatter : GTMLogBasicFormatter @end @implementation DumbFormatter + +#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 @@ -65,6 +76,11 @@ return [NSString stringWithFormat:@"DUMB [%d] %@", level, [super stringForFunc:nil withFormat:fmt valist:args level:level]]; } + +#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) +#pragma GCC diagnostic error "-Wmissing-format-attribute" +#endif // !__clang__ + @end // DumbFormatter -- cgit v1.2.3