id summary reporter owner description type status milestone component version severity resolution keywords cc 4798 date_time: valgrind warnings via strings_from_facet.hpp Lars Immisch az_sw_dude "On Ubuntu, with GNU libc6 (2.7-10ubuntu7), and a program that uses `boost::date_time::time_input_facet< boost::posix_time::ptime,char>` valgrind generates a warning: {{{ ==11026== Conditional jump or move depends on uninitialised value(s) ==11026== at 0x467C04B: __strftime_internal (strftime_l.c:574) ==11026== by 0x467DD4F: strftime_l (strftime_l.c:490) ==11026== by 0x456B420: std::__timepunct::_M_put(char*, unsigned int, char const*, tm const*) const (in /usr/lib/libstdc++.so.6.0.13) ==11026== by 0x452BB4C: std::time_put > >::do_put(std::ostreambuf_iterator >, std::ios_base&, char, tm const*, char, char) const (in /usr/lib/libstdc++.so.6.0.13) ==11026== by 0x452B0CF: std::time_put > >::put(std::ostreambuf_iterator >, std::ios_base&, char, tm const*, char const*, char const*) const (in /usr/lib/libstdc++.so.6.0.13) ==11026== by 0x8430C83: std::vector, std::allocator >, std::allocator, std::allocator > > > boost::date_time::gather_month_strings(std::locale const&, bool) (strings_from_facet.hpp:58) ==11026== by 0x84310D9: boost::date_time::format_date_parser::format_date_parser(std::string const&, std::locale const&) (format_date_parser.hpp:188) ==11026== by 0x8431435: boost::date_time::date_input_facet > >::date_input_facet(std::string const&, unsigned int) (date_facet.hpp:462) ==11026== by 0x84315E0: boost::date_time::time_input_facet > >::time_input_facet(std::string const&, unsigned int) (time_facet.hpp:696) }}} The actual problem is in GNU libc6, ''strftime_l.c:574'', which computes a 12 hour clock in `__strftime_internal` regardless of the format string: {{{ if (hour12 > 12) hour12 -= 12; else if (hour12 == 0) hour12 = 12; }}} The attached patch works around the warning by using an initialised struct tm in two places: {{{ tm tm_value = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; }}} We'd very much appreciate if the attached patch was accepted, even if it is only cosmetic." Patches closed To Be Determined date_time Boost Development Trunk Cosmetic fixed valgrind