qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 4/4] ui/cocoa: Ignore 'initializer overrides' warnings


From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH 4/4] ui/cocoa: Ignore 'initializer overrides' warnings
Date: Tue, 15 Feb 2022 14:23:59 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

On 15/2/22 14:19, Akihiko Odaki wrote:
On Tue, Feb 15, 2022 at 9:35 PM Peter Maydell <peter.maydell@linaro.org> wrote:

On Tue, 15 Feb 2022 at 12:13, Philippe Mathieu-Daudé via
<qemu-devel@nongnu.org> wrote:

We globally ignore the 'initializer overrides' warnings in C code
since commit c1556a812a ("configure: Disable (clang)
initializer-overrides warnings"). Unfortunately the ${gcc_flags}
variable is not propagated to Objective-C flags ($OBJCFLAGS).
Instead of reworking the configure script to test all supported
C flags in Objective-C and sanitize them, ignore the warning
locally with the GCC diagnostic #pragma (Clang ignores it).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

I'm not really a fan of #pragma GCC diagnostic directives in
specific source files, unless there's no alternative or
the issue really is specific to one file.

thanks
-- PMM

What about fixing then? Something like this should do:

--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -652,9 +652,7 @@ - (void) handleMonitorInput:(NSEvent *)event

      /* translates Macintosh keycodes to QEMU's keysym */

-    int without_control_translation[] = {
-        [0 ... 0xff] = 0,   // invalid key
-
+    int without_control_translation[256] = {
          [kVK_UpArrow]       = QEMU_KEY_UP,
          [kVK_DownArrow]     = QEMU_KEY_DOWN,
          [kVK_RightArrow]    = QEMU_KEY_RIGHT,

Clever =)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]