
Vladimir Prus wrote:
Andrey Semashev wrote:
Christoph Duelli wrote:
Andrey Semashev wrote:
What warnings? These:
boost_1_40_0/include/boost/date_time/gregorian/conversion.hpp:44: warning: missing initializer for member 'tm::tm_sec' boost_1_40_0/include/boost/date_time/gregorian/conversion.hpp:44: warning: missing initializer for member 'tm::tm_min'
Looks like GCC is overreacting. Omitting initializers is fine since these members should be initialized to zero.
Would not {0}, as opposed to {}, be enough to remove the warning? Just guessing ;-) No. That makes g++ happy about the first member (tm::tm_sec) and leaves it complaining about the rest. If you want the code to compile for different tm struct definitions (more members...) you either have to leave the code as it is (and maybe tell the compiler to shut up), or replace it by a memset (little performance penalty compared to ={}, I guess.)