From: Vadim Zeitlin Date: Sun, 20 May 2012 20:29:56 +0000 (+0000) Subject: Fix 62 harmless but annoying Clang warnings in wxOSX build. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/11716cbe14313011016472f56edb51c55aabe852 Fix 62 harmless but annoying Clang warnings in wxOSX build. Clang warns about using letters and digits in a switch on wxKeyCode enum which doesn't include them as elements. This is generally useful but really annoying in this case, especially due to the sheer number of warnings, so disable it using Clang-specific pragma. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 1505a9883e..aa37c9e249 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -1195,6 +1195,15 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) switch (code) { + // Clang warns about switch values not of the same type as (enumerated) + // switch controlling expression. This is generally useful but here we + // really want to be able to use letters and digits without making them + // part of wxKeyCode enum. +#ifdef __clang__ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wswitch" +#endif // __clang__ + case 'a': case 'A': keycode = kVK_ANSI_A; break; case 'b': case 'B': keycode = kVK_ANSI_B; break; case 'c': case 'C': keycode = kVK_ANSI_C; break; @@ -1232,6 +1241,10 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) case '7': keycode = kVK_ANSI_7; break; case '8': keycode = kVK_ANSI_8; break; case '9': keycode = kVK_ANSI_9; break; + +#ifdef __clang__ + #pragma clang diagnostic pop +#endif // __clang__ case WXK_BACK: keycode = kVK_Delete; break; case WXK_TAB: keycode = kVK_Tab; break;