[posix_time] truncation warning from VC71
Hi, (possible duplicate, but I think the original was rejected 'cause
of a mail alias. If not, please forgive the noise.)
I'm using boost 1.32 posix_time in some code that is intended to be
portable (MS VC7.1 / Solaris gcc 3.3.1 / RHLinux gcc 3.3.1).
When I build with VC 7.1.3088 on Windows XP Pro SP2 get warnings about
integer trunction (see below).
I can duplicate it by compiling a cpp file containing a single line:
#include "boost/date_time/posix_time/posix_time.hpp"
and I can work around it by:
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4244) // boost/posix_time has truncation warnings
#endif // _MSC_VER
#include "boost/date_time/posix_time/posix_time.hpp" //include all types
plus i/o
#ifdef _MSC_VER
#pragma warning(pop)
#endif // _MSC_VER
but this might hide real problems (or this might *BE* a real problem --
I haven't really looked into the difference between a
boost::date_time::counted_time_rep<config>::int_type. and a
boost::date_time::gregorian_calendar_base
Hi, (possible duplicate, but I think the original was rejected 'cause of a mail alias. If not, please forgive the noise.)
I'm using boost 1.32 posix_time in some code that is intended to be portable (MS VC7.1 / Solaris gcc 3.3.1 / RHLinux gcc 3.3.1).
When I build with VC 7.1.3088 on Windows XP Pro SP2 get warnings about integer trunction (see below).
I can duplicate it by compiling a cpp file containing a single line:
#include "boost/date_time/posix_time/posix_time.hpp"
and I can work around it by:
#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4244) // boost/posix_time has truncation warnings #endif // _MSC_VER #include "boost/date_time/posix_time/posix_time.hpp" //include all types
On Tue, 17 Jan 2006 12:08:06 -0600, Dale Wilson wrote plus i/o
#ifdef _MSC_VER #pragma warning(pop) #endif // _MSC_VER
but this might hide real problems (or this might *BE* a real problem -- I haven't really looked into the difference between a boost::date_time::counted_time_rep<config>::int_type. and a boost::date_time::gregorian_calendar_base
::date_int_type
Suggestions?
We've looked at and addressed a number of these warnings in 1.33 and non of them would ever create a run-time problem. They tended to be places where the number of months was extracted into a short, but b/c of context it was assured that the value would be within the range of a short -- but the compiler couldn't really deduce that and hence the warnings. Bottom line, I expect your warning disable will be safe. Jeff
participants (2)
-
Dale Wilson
-
Jeff Garland