From b9196fa647c7fef96e4b71fafdbd9ebd973fd6f2 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Mon, 15 May 2023 12:50:14 +0200 Subject: [PATCH] MT#57435 self-comparison always evaluates to true (XmlRpcValue.cpp) A mistake in the bool of the return in the XmlRpc::tmEq(): src/XmlRpcValue.cpp: In function 'bool XmlRpc::tmEq(const tm&, const tm&)': src/XmlRpcValue.cpp:144:52: warning: self-comparison always evaluates to true [-Wtautological-compare] 144 | t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday && | Second one should be of the `t2` variable. Change-Id: I7fbf3b1b2f9becdb14db2e994fb4d0abf0937964 --- apps/xmlrpc2di/xmlrpc++/src/XmlRpcValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/xmlrpc2di/xmlrpc++/src/XmlRpcValue.cpp b/apps/xmlrpc2di/xmlrpc++/src/XmlRpcValue.cpp index 69627a41..fd49c1e0 100644 --- a/apps/xmlrpc2di/xmlrpc++/src/XmlRpcValue.cpp +++ b/apps/xmlrpc2di/xmlrpc++/src/XmlRpcValue.cpp @@ -141,7 +141,7 @@ namespace XmlRpc { // Predicate for tm equality static bool tmEq(struct tm const& t1, struct tm const& t2) { return t1.tm_sec == t2.tm_sec && t1.tm_min == t2.tm_min && - t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday && + t1.tm_hour == t2.tm_hour && t1.tm_mday == t2.tm_mday && t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year; }