diff options
author | Fedja Beader <fedja@protonmail.ch> | 2024-08-28 14:15:53 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2024-08-28 14:15:53 +0000 |
commit | e304e3feb771f3e1000addce04e7557f1211192a (patch) | |
tree | e6f6cf402cf4a7af3ad04df27b6ada23147901bf /src | |
parent | df7344aa9c44e8a2736df02b8569cf32b41cb03a (diff) | |
download | plus-e304e3feb771f3e1000addce04e7557f1211192a.tar.gz plus-e304e3feb771f3e1000addce04e7557f1211192a.tar.bz2 plus-e304e3feb771f3e1000addce04e7557f1211192a.tar.xz plus-e304e3feb771f3e1000addce04e7557f1211192a.zip |
Squash gcc8 -Wformat-y2k warning
* Run gcc8 job again in this MR
* Squash the %c strftime gcc warning
****
mana/plus!100
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/stringutils.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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"; } |