[pim/libkleo] src/kleo: cppcheck: Silence uninitMemberVarNoCtor warning for Expiration

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

cppcheck: Silence uninitMemberVarNoCtor warning for Expiration

Add a special value to the ExpirationStatus enum to initialize the
status member of Expiration.

M  +2    -1    src/kleo/expirychecker.h

https://invent.kde.org/pim/libkleo/-/commit/7cbaed9f4eee690e5d80de168ee7405a52335ab3

diff --git a/src/kleo/expirychecker.h b/src/kleo/expirychecker.h
index 48dfbd04..1f6e73b2 100644
--- a/src/kleo/expirychecker.h
+++ b/src/kleo/expirychecker.h
@@ -66,12 +66,13 @@ public:
         NoSuitableSubkey,
         InvalidKey,
         InvalidCheckFlags,
+        NoStatus, // special value for initialization; never used for an ExpiryChecker::Result
     };
     Q_ENUM(ExpirationStatus)
 
     struct Expiration {
         GpgME::Key certificate;
-        ExpirationStatus status;
+        ExpirationStatus status = NoStatus;
         // duration is days until expiry if status is ExpiresSoon (i.e. 0
         // if expiry is today, 1 if it's tomorrow, etc.),
         // days since expiry if status is Expired, and
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.