From e304e3feb771f3e1000addce04e7557f1211192a Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Wed, 28 Aug 2024 14:15:53 +0000 Subject: Squash gcc8 -Wformat-y2k warning * Run gcc8 job again in this MR * Squash the %c strftime gcc warning **** mana/plus!100 --- src/utils/stringutils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index cd2a87ab2..946d08fc5 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -947,9 +947,14 @@ std::string timeToStr(const uint32_t time) char buf[101]; const time_t tempTime = time; tm *const timeInfo = localtime(&tempTime); - // %c is locale-defined format + PRAGMA8(GCC diagnostic push) + PRAGMA8(GCC diagnostic ignored "-Wformat-y2k") + // %c is locale-defined format. gcc8 complains: + // '%c' yields only last 2 digits of year in some locales. + // However, mails *currently, on ML* expire in way less than a year. if (strftime(&buf[0], 100, "%c", timeInfo) != 0U) return std::string(buf); + PRAGMA8(GCC diagnostic pop) return "unknown"; } -- cgit v1.2.3-70-g09d2