Opened 9 years ago

Closed 9 years ago

#9147 closed Bugs (fixed)

uninitialized std::tm

Reported by: Johan Lundberg <lundberj@…> Owned by: viboes
Milestone: Boost 1.55.0 Component: chrono
Version: Boost 1.54.0 Severity: Cosmetic
Keywords: Cc:

Description

The struct std::tm seems uninitialized, or have possibly uninitialized members in a few places.

For example in https://svn.boost.org/trac/boost/changeset/85610

The most common patterns in boost seems to be to do

  std::tm x;
  std::memset(&x, 0, sizeof(x)); 

which seems good.

Some different/missing/suspicious initializations:

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)

Change History (3)

comment:1 by viboes, 9 years ago

Status: newassigned

Committed [85706]

comment:2 by viboes, 9 years ago

Milestone: To Be DeterminedBoost 1.55.0

comment:3 by viboes, 9 years ago

Resolution: fixed
Status: assignedclosed

(In [85816]) Chrono: initialize std::tm variables to all 0 to fix #9147.

Note: See TracTickets for help on using tickets.