From dd2507b7f97b9601e60ab7529e24d4b7a9cf657e Mon Sep 17 00:00:00 2001 From: Tomáš Znamenáček Date: Mon, 12 Oct 2015 09:28:19 +0200 Subject: Silenced a potential “tautological compare” warning in MASShortcutView. Fixes #76. I considered putting the #pragma just around the particular compare line, but I think having it around the whole block is more readable and there’s little chance of having some legitimate warnings silenced. --- Framework/MASShortcutView.m | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Framework/MASShortcutView.m') diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index 2e303cf..8540e61 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -138,6 +138,12 @@ static const CGFloat MASButtonFontSize = 11; [self setNeedsDisplay:YES]; // Give VoiceOver users feedback on the result. Requires at least 10.9 to run. + // We’re silencing the “tautological compare” warning here so that if someone + // takes the naked source files and compiles them with -Wall, the following + // NSAccessibilityPriorityKey comparison doesn’t cause a warning. See: + // https://github.com/shpakovski/MASShortcut/issues/76 + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" if (_recording == NO && (&NSAccessibilityPriorityKey != NULL)) { NSString* msg = _shortcutValue ? MASLocalizedString(@"Shortcut set", @"VoiceOver: Shortcut set") : @@ -148,6 +154,7 @@ static const CGFloat MASButtonFontSize = 11; }; NSAccessibilityPostNotificationWithUserInfo(self, NSAccessibilityAnnouncementRequestedNotification, announcementInfo); } + #pragma clang diagnostic pop } - (void)setShortcutValue:(MASShortcut *)shortcutValue -- cgit v1.2.3