[pim/libkleo] src: cppcheck: Silence useless uninitMemberVarNoCtor warning

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit a050c523a61619d393ac8cedbdc558b263fc45cc by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 30/07/2026 at 12:09.
Pushed by kloecker into branch 'master'.

cppcheck: Silence useless uninitMemberVarNoCtor warning

It makes no sense to initialize the member variables of the anonymous
structs because they are properly initialized by the initialization lists
passed to the arrays of those structs.

M  +2    -2    src/kleo/enum.cpp
M  +1    -1    src/kleo/kconfigbasedkeyfilter.cpp
M  +1    -1    src/ui/cryptoconfigmodule.cpp

https://invent.kde.org/pim/libkleo/-/commit/a050c523a61619d393ac8cedbdc558b263fc45cc

diff --git a/src/kleo/enum.cpp b/src/kleo/enum.cpp
index aebd250a..527ac456 100644
--- a/src/kleo/enum.cpp
+++ b/src/kleo/enum.cpp
@@ -25,9 +25,9 @@
 #include <functional>
 
 static const struct {
-    Kleo::CryptoMessageFormat format;
+    Kleo::CryptoMessageFormat format; // cppcheck-suppress uninitMemberVarNoCtor
     const KLazyLocalizedString displayName;
-    const char *configName;
+    const char *configName; // cppcheck-suppress uninitMemberVarNoCtor
 } cryptoMessageFormats[] = {
     // clang-format off
     {Kleo::InlineOpenPGPFormat, kli18n("Inline OpenPGP (deprecated)"), "inline openpgp"},
diff --git a/src/kleo/kconfigbasedkeyfilter.cpp b/src/kleo/kconfigbasedkeyfilter.cpp
index 1cf2e602..57c4f82a 100644
--- a/src/kleo/kconfigbasedkeyfilter.cpp
+++ b/src/kleo/kconfigbasedkeyfilter.cpp
@@ -101,7 +101,7 @@ KeyFilter::FontDescription KeyFilter::FontDescription::resolve(const FontDescrip
 }
 
 static const struct {
-    const char *name;
+    const char *name; // cppcheck-suppress uninitMemberVarNoCtor
     Key::OwnerTrust trust;
     UserID::Validity validity;
 } ownerTrustAndValidityMap[] = {
diff --git a/src/ui/cryptoconfigmodule.cpp b/src/ui/cryptoconfigmodule.cpp
index 6e35e54f..7586393c 100644
--- a/src/ui/cryptoconfigmodule.cpp
+++ b/src/ui/cryptoconfigmodule.cpp
@@ -587,7 +587,7 @@ void Kleo::CryptoConfigEntryLineEdit::doLoad()
    traces of plaintext on the disk.  */
 static const struct {
     const KLazyLocalizedString label;
-    const char *name;
+    const char *name; // cppcheck-suppress uninitMemberVarNoCtor
 } debugLevels[] = {
     {kli18n("0 - None"), "none"},
     {kli18n("1 - Basic"), "basic"},
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.