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+ASL.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Foundation/GTMLogger+ASL.m') diff --git a/Foundation/GTMLogger+ASL.m b/Foundation/GTMLogger+ASL.m index 58bc710..a4299dc 100644 --- a/Foundation/GTMLogger+ASL.m +++ b/Foundation/GTMLogger+ASL.m @@ -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 @@ -116,6 +126,10 @@ [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 -- cgit v1.2.3