forked from HowardHinnant/date
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.
This commit is contained in:
committed by
Howard Hinnant
parent
2e213abb76
commit
2032fccbb7
@@ -4566,7 +4566,7 @@ to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||
{
|
||||
using namespace std;
|
||||
using namespace std::chrono;
|
||||
tm tm;
|
||||
tm tm{};
|
||||
#if !ONLY_C_LOCALE
|
||||
auto& facet = use_facet<time_put<CharT>>(os.getloc());
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user