Re: [Boost-bugs] [Boost C++ Libraries] #3477: warning: missing initializer for member ‘tm::tm_sec’ ..

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3477: warning: missing initializer for member ‘tm::tm_sec’ ..
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-03-28 15:45:22


#3477: warning: missing initializer for member ‘tm::tm_sec’ ..
--------------------------+-------------------------------------------------
 Reporter: me@… | Owner: az_sw_dude
     Type: Patches | Status: new
Milestone: | Component: date_time
  Version: Boost 1.40.0 | Severity: Cosmetic
 Keywords: |
--------------------------+-------------------------------------------------

Comment(by marshall):

 My testing shows that gcc 4.2.1 does not generate this error.
 {{{
 #include <boost/date_time/gregorian/conversion.hpp>

 int main ( int argc, char *argv[] ) {}

 $ g++ -I /Marshall/Sources/boost/boost_1_42_0 -wAll junk.cpp
 $
 $ g++ --version
 i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1)
 }}}

 Comment (via email) from AndySem:

 I'm not sure the patch is valid. std::tm can have different number of
 members on different compilers and thus the patch may bring either
 warnings or errors on other platforms. And the warning is nonsense in the
 first place, because zero initialization is intended to be done by the
 compiler (which it actually does).

 I think, at least conditional compilation should be used in this case.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3477#comment:1>
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:02 UTC