Boost logo

Boost :

From: Michel André (michel.andre_at_[hidden])
Date: 2002-10-18 16:39:18


Sorry for the previous post. I slipped on my keyboard ;)

Another question:

There are some functions in gregorian::date wich is documented in doxygen
but not in the boost library docs. Like day_number accessor and constructor
and *julian*, are these meant to be a part of the public interface or an
implementation detail?

> Ok, well I don't see why that would happen. Anyway the regression
> test on VC7 are fine, so I'm not worried. Is that the full snap
> of the error or is the :xxx and :yyy shortened? If so, please
> include the full text.

Well the following in a cpp file and /W4
#define DATE_TIME_INLINE

#include <boost/date_time/posix_time/posix_time.hpp>

void date_time_test() {}

gives the following output (pardon for the lengthy output):

date_time_test.cpp
c:\Packages\boost\boost\date_time\gregorian\greg_month.hpp(36) : warning
C4244: 'argument' : conversion from 'boost::gregorian::months_of_year' to
'boost::CV::constrained_value<value_policies>::value_type', possible loss of
data
        with
        [
            value_policies=boost::gregorian::greg_month_policies
        ]
c:\Packages\boost\boost\date_time\time_parsing.hpp(65) : warning C4267:
'initializing' : conversion from 'size_t' to 'int', possible loss of data
c:\Packages\boost\boost\date_time\time_duration.hpp(54) : warning C4244:
'return' : conversion from
'boost::date_time::time_resolution_traits<frac_sec_type,res,resolution_adjus
t,frac_digits,v_type>::fractional_seconds_type' to
'boost::date_time::time_duration<T,rep_type>::hour_type', possible loss of
data
        with
        [
            frac_sec_type=boost::int64_t,
            res=micro,
            resolution_adjust=0x0f4240,
            frac_digits=6,
            v_type=boost::int32_t
        ]
        and
        [
            T=boost::posix_time::time_duration,
            rep_type=boost::posix_time::time_res_traits
        ]
        c:\Packages\boost\boost\date_time\time_duration.hpp(53) : while
compiling class-template member function
'boost::date_time::time_duration<T,rep_type>::hour_type
boost::date_time::time_duration<T,rep_type>::hours(void) const'
        with
        [
            T=boost::posix_time::time_duration,
            rep_type=boost::posix_time::time_res_traits
        ]

c:\Packages\boost\boost\date_time\posix_time\posix_time_config.hpp(62) : see
reference to class template instantiation
'boost::date_time::time_duration<T,rep_type>' being compiled
        with
        [
            T=boost::posix_time::time_duration,
            rep_type=boost::posix_time::time_res_traits
        ]
c:\Packages\boost\boost\date_time\time_duration.hpp(59) : warning C4244:
'return' : conversion from
'boost::date_time::time_resolution_traits<frac_sec_type,res,resolution_adjus
t,frac_digits,v_type>::fractional_seconds_type' to
'boost::date_time::time_duration<T,rep_type>::min_type', possible loss of
data
        with
        [
            frac_sec_type=boost::int64_t,
            res=micro,
            resolution_adjust=0x0f4240,
            frac_digits=6,
            v_type=boost::int32_t
        ]
        and
        [
            T=boost::posix_time::time_duration,
            rep_type=boost::posix_time::time_res_traits
        ]
        c:\Packages\boost\boost\date_time\time_duration.hpp(58) : while
compiling class-template member function
'boost::date_time::time_duration<T,rep_type>::min_type
boost::date_time::time_duration<T,rep_type>::minutes(void) const'
        with
        [
            T=boost::posix_time::time_duration,
            rep_type=boost::posix_time::time_res_traits
        ]
c:\Packages\boost\boost\date_time\time_duration.hpp(64) : warning C4244:
'return' : conversion from
'boost::date_time::time_resolution_traits<frac_sec_type,res,resolution_adjus
t,frac_digits,v_type>::fractional_seconds_type' to
'boost::date_time::time_duration<T,rep_type>::sec_type', possible loss of
data
        with
        [
            frac_sec_type=boost::int64_t,
            res=micro,
            resolution_adjust=0x0f4240,
            frac_digits=6,
            v_type=boost::int32_t
        ]
        and
        [
            T=boost::posix_time::time_duration,
            rep_type=boost::posix_time::time_res_traits
        ]
        c:\Packages\boost\boost\date_time\time_duration.hpp(63) : while
compiling class-template member function
'boost::date_time::time_duration<T,rep_type>::sec_type
boost::date_time::time_duration<T,rep_type>::seconds(void) const'
        with
        [
            T=boost::posix_time::time_duration,
            rep_type=boost::posix_time::time_res_traits
        ]
c:\Packages\boost\boost\date_time\time_system_counted.hpp(39) : warning
C4244: 'initializing' : conversion from
'boost::date_time::counted_time_rep<config>::int_type' to
'boost::date_time::gregorian_calendar_base<ymd_type_,date_int_type_>::date_i
nt_type', possible loss of data
        with
        [
            config=boost::posix_time::millisec_posix_time_system_config
        ]
        and
        [
            ymd_type_=boost::gregorian::greg_year_month_day,
            date_int_type_=boost::date_time::int_adapter<unsigned
long>::int_type
        ]
        c:\Packages\boost\boost\date_time\time_system_counted.hpp(38) :
while compiling class-template member function
'boost::date_time::counted_time_rep<config>::date_type
boost::date_time::counted_time_rep<config>::date(void) const'
        with
        [
            config=boost::posix_time::millisec_posix_time_system_config
        ]
        c:\Packages\boost\boost\date_time\time_system_counted.hpp(72) : see
reference to class template instantiation
'boost::date_time::counted_time_rep<config>' being compiled
        with
        [
            config=boost::posix_time::millisec_posix_time_system_config
        ]
        c:\Packages\boost\boost\date_time\time.hpp(48) : see reference to
class template instantiation
'boost::date_time::counted_time_system<time_rep>' being compiled
        with
        [
            time_rep=boost::posix_time::int64_time_rep
        ]
        c:\Packages\boost\boost\date_time\posix_time\ptime.hpp(19) : see
reference to class template instantiation
'boost::date_time::base_time<T,time_system>' being compiled
        with
        [
            T=boost::posix_time::ptime,
            time_system=boost::posix_time::posix_time_system
        ]
c:\Packages\boost\boost\date_time\gregorian_calendar.ipp(61) : warning
C4244: 'initializing' : conversion from 'unsigned long' to 'unsigned short',
possible loss of data
        c:\Program Files\Microsoft Visual Studio
.NET\Vc7\include\xutility(433) : while compiling class-template member
function
'boost::date_time::gregorian_calendar_base<ymd_type_,date_int_type_>::ymd_ty
pe
boost::date_time::gregorian_calendar_base<ymd_type_,date_int_type_>::from_da
y_number(boost::date_time::gregorian_calendar_base<ymd_type_,date_int_type_>
::date_int_type)'
        with
        [
            ymd_type_=boost::gregorian::greg_year_month_day,
            date_int_type_=boost::date_time::int_adapter<unsigned
long>::int_type
        ]
        c:\Packages\boost\boost\date_time\gregorian\greg_calendar.hpp(22) :
see reference to class template instantiation
'boost::date_time::gregorian_calendar_base<ymd_type_,date_int_type_>' being
compiled
        with
        [
            ymd_type_=boost::gregorian::greg_year_month_day,
            date_int_type_=boost::date_time::int_adapter<unsigned
long>::int_type
        ]
c:\Packages\boost\boost\date_time\gregorian_calendar.ipp(62) : warning
C4244: 'initializing' : conversion from 'unsigned long' to 'unsigned short',
possible loss of data
c:\Packages\boost\boost\date_time\gregorian_calendar.ipp(66) : warning
C4244: 'argument' : conversion from
'boost::date_time::gregorian_calendar_base<ymd_type_,date_int_type_>::date_i
nt_type' to 'unsigned short', possible loss of data
        with
        [
            ymd_type_=boost::gregorian::greg_year_month_day,
            date_int_type_=boost::date_time::int_adapter<unsigned
long>::int_type
        ]
c:\Packages\boost\boost\date_time\date_parsing.hpp(30) : warning C4244:
'argument' : conversion from 'int' to 'unsigned short', possible loss of
data
        c:\Packages\boost\boost\date_time\gregorian\parsers.hpp(17) : see
reference to function template instantiation 'date_type
boost::date_time::parse_date<boost::gregorian::date>(const std::string &)'
being compiled
        with
        [
            date_type=boost::gregorian::date
        ]
c:\Packages\boost\boost\date_time\date_parsing.hpp(31) : warning C4244:
'argument' : conversion from 'int' to 'short', possible loss of data
c:\Packages\boost\boost\date_time\date_parsing.hpp(32) : warning C4244:
'argument' : conversion from 'int' to 'unsigned short', possible loss of
data
c:\Packages\boost\boost\date_time\date_parsing.hpp(54) : warning C4244:
'argument' : conversion from 'int' to 'unsigned short', possible loss of
data
        c:\Packages\boost\boost\date_time\gregorian\parsers.hpp(22) : see
reference to function template instantiation 'date_type
boost::date_time::parse_undelimited_date<boost::gregorian::date>(const
std::string &)' being compiled
        with
        [
            date_type=boost::gregorian::date
        ]
c:\Packages\boost\boost\date_time\date_parsing.hpp(55) : warning C4244:
'argument' : conversion from 'int' to 'short', possible loss of data
c:\Packages\boost\boost\date_time\date_parsing.hpp(56) : warning C4244:
'argument' : conversion from 'int' to 'unsigned short', possible loss of
data

And I'm sure all conversions are ok and considered. So it's a minor issue,
but it's nice when libraries is warning level 4 compliant.

BTW thanks for a good date_time library.

We are in the process of migrating a medium sized project to use
boost.date_time throughout. We have waited to quite late in the project to
handle dates and times fully because we have long waited for the library. I
decided to use the library since I saw the first discussions and drafts on
this list. I thought it could interest you to know that there are some early
adopters out here ;)

/Michel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk