Re: [Boost-bugs] [Boost C++ Libraries] #5550: Missing initializer warning in date_time/date_facet.hpp

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5550: Missing initializer warning in date_time/date_facet.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-19 14:22:27


#5550: Missing initializer warning in date_time/date_facet.hpp
--------------------------------------+------------------------
  Reporter: Derek McGowan <derek@…> | Owner: az_sw_dude
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: date_time
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+------------------------
Changes (by Johan Lundberg <lundberj@…>):

 * status: closed => reopened
 * version: Boost 1.46.1 => Boost 1.54.0
 * resolution: fixed =>

Comment:

 This problem is there at two more places in another file (boost 1.54
 beta1), giving the same errors/warnings as above.

 /date_time/strings_from_facet.hpp:53:20: warning: missing initializer for
 member ‘tm::tm_gmtoff’ [-Wmissing-field-initializers]
 ''(and ten more like it)''

 /date_time/strings_from_facet.hpp:106:20: warning: missing initializer for
 member ‘tm::tm_zone’ [-Wmissing-field-initializers]
 ''(and ten more like it)''

 Now, changeset https://svn.boost.org/trac/boost/changeset/80797 suggest
 the change from

 tm tm_value = {};

 to

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

 I've made this change (at two places) and that silences all related
 warnings. Using the more obvious tm_value = {0,0,0,0,0,0,0,0,0} is not a
 good idea since some implementations add their own values at the end of
 the struct.


 '''How to reproduce:'''

 #include "date_time/posix_time/posix_time.hpp"
 int main(){}

 //compile with gcc4.7.2, default options.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5550#comment:7>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC