Modify

Ticket #9147 (closed Bugs: fixed)

Opened 7 months ago

Last modified 7 months ago

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)

Attachments

Change History

comment:1 Changed 7 months ago by viboes

  • Status changed from new to assigned

Committed [85706]

comment:2 Changed 7 months ago by viboes

  • Milestone changed from To Be Determined to Boost 1.55.0

comment:3 Changed 7 months ago by viboes

  • Status changed from assigned to closed
  • Resolution set to fixed

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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.