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,