From 976d93d91032cb5471da9f0f6ceb22110c9376ce Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 3 Sep 2023 18:01:54 +0300 Subject: [PATCH] LibDNS: Fix compilation with signed time_t With signed 32-bit time_t, the type of time_t + m_ttl is unsigned int, which results in -Werror=sign-compare. Fix this by explicitly casting it back to time_t. --- Userland/Libraries/LibDNS/Answer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibDNS/Answer.cpp b/Userland/Libraries/LibDNS/Answer.cpp index 33471068ba..eb8d86e174 100644 --- a/Userland/Libraries/LibDNS/Answer.cpp +++ b/Userland/Libraries/LibDNS/Answer.cpp @@ -24,7 +24,7 @@ Answer::Answer(Name const& name, RecordType type, RecordClass class_code, u32 tt bool Answer::has_expired() const { - return time(nullptr) >= m_received_time + m_ttl; + return time(nullptr) >= static_cast(m_received_time + m_ttl); } unsigned Answer::hash() const