From 2032fccbb7eb9f300240933921a356a437f80027 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 3 Oct 2017 21:22:16 +0300 Subject: [PATCH] Fix valgrind warning about uninitialized variable use in to_stream() tm variable is not initialized in to_stream(), and valgrind warns about "Conditional jump or move depends on uninitialised value(s)". This is a false positive, as strftime always reads tm_hour, even if it ends up never using it. To silence the warnings, initialize tm to zero. --- include/date/date.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/date/date.h b/include/date/date.h index 4780aa8..fba24cd 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -4566,7 +4566,7 @@ to_stream(std::basic_ostream& os, const CharT* fmt, { using namespace std; using namespace std::chrono; - tm tm; + tm tm{}; #if !ONLY_C_LOCALE auto& facet = use_facet>(os.getloc()); #endif