Opened 10 years ago

Closed 5 years ago

#6936 closed Bugs (worksforme)

Warning 4244 in posix_time_zone.hpp

Reported by: michael.cowperthwaite@… Owned by: James E. King, III
Milestone: To Be Determined Component: date_time
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

The warnings:

C:\Dev\Include\boost/date_time/local_time/posix_time_zone.hpp(433) : warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data
1>        C:\Dev\Include\boost/date_time/local_time/posix_time_zone.hpp(414) : while compiling class template member function 'void boost::local_time::posix_time_zone_base<CharT>::julian_no_leap(const std::basic_string<_Elem,_Traits,_Ax> &,const std::basic_string<_Elem,_Traits,_Ax> &)'
1>        with
1>        [
1>            CharT=char,
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]
1>        .\MYFILE.cpp(NN) : see reference to class template instantiation 'boost::local_time::posix_time_zone_base<CharT>' being compiled
1>        with
1>        [
1>            CharT=char
1>        ]
1>C:\Dev\Include\boost/date_time/local_time/posix_time_zone.hpp(435) : warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data

The line in my code that spawns this:

time_zone_ptr timezone;
string tz("UTC0");  // may be changed
//...
timezone.reset(new posix_time_zone(tz.c_str()));  // warnings from here

The warnings occur within body of julian_no_leap() at the instantiation of new partial_date_dst_rule, specifically, one each for the start_rule and end_rule constructors.

MSVC 2008, compiling on and for Windows 7.

Change History (3)

comment:1 by viboes, 10 years ago

Component: Nonedate_time
Owner: set to az_sw_dude

comment:2 by James E. King, III, 5 years ago

Owner: changed from az_sw_dude to James E. King, III

comment:3 by James E. King, III, 5 years ago

Resolution: worksforme
Status: newclosed

Cannot reproduce this in boost 1.66.0 with msvc-14.1

Note: See TracTickets for help on using tickets.