Opened 2 weeks ago

#13373 new Bugs

Warning in Boost.Log or Boost.DateTime with VS2017

Reported by: christof.krueger@… Owned by:
Milestone: To Be Determined Component: None
Version: Boost 1.65.0 Severity: Problem
Keywords: Cc:


I'm getting the following compiler warning while compiling my code with VS2017 on a Windows 7 machine:

C:\Users\<...>\boost-1_65_1\boost/log/support/date_time.hpp(66): warning C4244: '=': conversion from '__int64' to 'uint32_t', possible loss of data
C:\Users\<...>\boost-1_65_1\boost/log/support/date_time.hpp(67): warning C4244: '=': conversion from '__int64' to 'uint32_t', possible loss of data
C:\Users\<...>\boost-1_65_1\boost/log/support/date_time.hpp(68): warning C4244: '=': conversion from '__int64' to 'uint32_t', possible loss of data

I'm using a simple console log (boost::log::add_console_log(std::clog)) wich a formatter created like this:

namespace expr = boost::log::expressions;
auto fmtTimeStamp = expr::format_date_time<boost::posix_time::ptime>("TimeStamp", %Y-%m-%d %H:%M:%S.%f");
boost::log::formatter logFmt
    = expr::format("[%1%] [%2%] {%3%} <%4%> %5%")
        % fmtTimeStamp
        % expr::attr<my_severity_level_type>("Severity")
        % expr::attr<std::string>("ThreadName").or_default(std::string("?"))
        % expr::attr<std::string>("Channel").or_default(std::string("?"))
        % expr::message;

Is there anything I could do about? Or is it something that should be fixed within Boost? I'd like to have warning-free code wherever possible, of course.

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.