From 5b3c4eb2d13cf2b110aab78042e9e16917d4db91 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Fri, 1 Jul 2022 10:05:35 -0230 Subject: [PATCH] Fix warnings in gcc and clang for missing initializers. Normally I would disable the warning completely (everywhere), but it's very useful to have. In this case, the code can be much faster, as it saves having to initialize empty string objects. So we disable the warning selectively. --- src/emucore/EventHandler.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 684491faa..a635cd5de 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -2784,6 +2784,11 @@ void EventHandler::exitEmulation(bool checkLauncher) } } +#if defined(__clang__) + #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#elif defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EventHandler::EmulActionList EventHandler::ourEmulActionList = { { { Event::Quit, "Quit" },