Boost C++ Libraries: Ticket #9147: uninitialized std::tm https://svn.boost.org/trac10/ticket/9147 <p> The struct std::tm seems uninitialized, or have possibly uninitialized members in a few places. </p> <p> For example in <a class="ext-link" href="https://svn.boost.org/trac/boost/changeset/85610"><span class="icon">​</span>https://svn.boost.org/trac/boost/changeset/85610</a> </p> <p> The most common patterns in boost seems to be to do </p> <pre class="wiki"> std::tm x; std::memset(&amp;x, 0, sizeof(x)); </pre><p> which seems good. </p> <p> Some different/missing/suspicious initializations: </p> <pre class="wiki">boost/log/detail/decomposed_time.hpp: std::tm res = {}; boost/chrono/io/time_point_io.hpp (possibly several) util/gregorian.cpp - the gregorian_calendar class members boost/date_time/microsec_time_clock.hpp (std::tm curr possibly not fully initialized) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9147 Trac 1.4.3 viboes Sat, 21 Sep 2013 20:53:33 GMT status changed https://svn.boost.org/trac10/ticket/9147#comment:1 https://svn.boost.org/trac10/ticket/9147#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Committed <a class="changeset" href="https://svn.boost.org/trac10/changeset/85706" title="Chrono: initialize std::tm to all 0.">[85706]</a> </p> Ticket viboes Sat, 21 Sep 2013 20:53:47 GMT milestone changed https://svn.boost.org/trac10/ticket/9147#comment:2 https://svn.boost.org/trac10/ticket/9147#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> Ticket viboes Sun, 22 Sep 2013 07:29:17 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9147#comment:3 https://svn.boost.org/trac10/ticket/9147#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85816" title="Chrono: initialize std::tm variables to all 0 to fix #9147.">[85816]</a>) Chrono: initialize std::tm variables to all 0 to fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9147" title="#9147: Bugs: uninitialized std::tm (closed: fixed)">#9147</a>. </p> Ticket