aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-11-05 16:53:55 +0000
committermark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-11-05 16:53:55 +0000
commit4b6e0bb9523efe00100311f94f44cfd9faa633c1 (patch)
treef3a14a912b2dca8f507ab5c838409853722a509e /src/client/mac
parentmap_serializers_unittest: fix unused variable warning (diff)
downloadbreakpad-4b6e0bb9523efe00100311f94f44cfd9faa633c1.tar.xz
NSLocalizedString compatibility (10.8 SDK and clang trunk -Wformat-extra-args)
Apparently, as of the 10.8 SDK, Apple has quietly decided that the first argument to NSLocalizedString is supposed to be usable as-is as a format string, instead of simply being the key to obtain a usable format string. The recent clang trunk enforces this, resulting in build breaks like crash_report_sender.m:560:14: error: data argument not used by format string [-Werror,-Wformat-extra-args] displayName]; ^ Breaking the result of NSLocalizedString into a temporary NSString* is enough to suppress the warning. BUG=chromium:314109 R=thakis@chromium.org Review URL: https://breakpad.appspot.com/674003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1230 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac')
-rw-r--r--src/client/mac/sender/crash_report_sender.m24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/client/mac/sender/crash_report_sender.m b/src/client/mac/sender/crash_report_sender.m
index 37eb255e..88d26fb0 100644
--- a/src/client/mac/sender/crash_report_sender.m
+++ b/src/client/mac/sender/crash_report_sender.m
@@ -555,13 +555,13 @@ doCommandBySelector:(SEL)commandSelector {
displayName = [[uploader_ parameters] objectForKey:@BREAKPAD_PRODUCT];
if ([self isOnDemand]) {
- return [NSString
- stringWithFormat:NSLocalizedString(@"noCrashDialogHeader", @""),
- displayName];
+ // Local variable to pacify clang's -Wformat-extra-args.
+ NSString* format = NSLocalizedString(@"noCrashDialogHeader", @"");
+ return [NSString stringWithFormat:format, displayName];
} else {
- return [NSString
- stringWithFormat:NSLocalizedString(@"crashDialogHeader", @""),
- displayName];
+ // Local variable to pacify clang's -Wformat-extra-args.
+ NSString* format = NSLocalizedString(@"crashDialogHeader", @"");
+ return [NSString stringWithFormat:format, displayName];
}
}
@@ -576,13 +576,13 @@ doCommandBySelector:(SEL)commandSelector {
vendor = @"unknown vendor";
if ([self isOnDemand]) {
- return [NSString
- stringWithFormat:NSLocalizedString(@"noCrashDialogMsg", @""),
- vendor, displayName];
+ // Local variable to pacify clang's -Wformat-extra-args.
+ NSString* format = NSLocalizedString(@"noCrashDialogMsg", @"");
+ return [NSString stringWithFormat:format, vendor, displayName];
} else {
- return [NSString
- stringWithFormat:NSLocalizedString(@"crashDialogMsg", @""),
- vendor];
+ // Local variable to pacify clang's -Wformat-extra-args.
+ NSString* format = NSLocalizedString(@"crashDialogMsg", @"");
+ return [NSString stringWithFormat:format, vendor];
}
}