From a03441f959242f706ed24e2efee7a61fe939aeec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Nov 2017 16:57:40 +0100 Subject: [PATCH] Suppress harmless -Wmissing-fields-initialize in wxSecretStore This warning is difficult to avoid as we don't want to initialize the unused/reserved fields of SecretSchema struct, yet the compiler warns about it (when using -Wextra). --- src/unix/secretstore.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/unix/secretstore.cpp b/src/unix/secretstore.cpp index f18d5a0e6d..e72ce36248 100644 --- a/src/unix/secretstore.cpp +++ b/src/unix/secretstore.cpp @@ -235,6 +235,11 @@ private: // helper function to make changing the code later simpler. static SecretSchema* GetSchema() { + // SecretSchema struct has some "reserved" fields in it which we don't + // want to initialize, but this results in this warning if it's + // enabled, so just suppress it here. + wxGCC_WARNING_SUPPRESS(missing-field-initializers) + static SecretSchema s_schema = { "org.freedesktop.Secret.Generic", @@ -246,6 +251,8 @@ private: } }; + wxGCC_WARNING_RESTORE(missing-field-initializers) + return &s_schema; }