Boost C++ Libraries: Ticket #3608: run time warning in vc9 when parsing ptime (with patch) https://svn.boost.org/trac10/ticket/3608 <p> run time warning(loss of precision when converting between types) in vc9 (with run time checks enabled) when parsing ptime with year format </p> <p> reproduceable testcase: parse "20090101" with facet "%Y-%m-%dT%H:%M:%S%F" makes vc stop execution to notify of mismatch. </p> <p> the patch: sets the local variable to unsigned int (instead of unsigned short) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3608 Trac 1.4.3 Thomas.Lemm@… Wed, 11 Nov 2009 10:19:16 GMT attachment set https://svn.boost.org/trac10/ticket/3608 https://svn.boost.org/trac10/ticket/3608 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-date_time-parse_ptrime_runtime_type_mismatch.patch</span> </li> </ul> <p> the patch </p> Ticket James E. King, III Wed, 27 Dec 2017 15:31:40 GMT owner changed https://svn.boost.org/trac10/ticket/3608#comment:1 https://svn.boost.org/trac10/ticket/3608#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">az_sw_dude</span> to <span class="trac-author">James E. King, III</span> </li> </ul> Ticket James E. King, III Wed, 27 Dec 2017 15:33:08 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3608#comment:2 https://svn.boost.org/trac10/ticket/3608#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> As of 1.66.0 I cannot reproduce this issue. I added this test to testtime_input_facet.cpp (at the end): </p> <pre class="wiki"> // trac-3608 (https://svn.boost.org/trac10/ticket/3608) { const std::string value = "20090101"; boost::posix_time::time_input_facet* facet5 = new boost::posix_time::time_input_facet("%Y-%m-%dT%H:%M:%S%F"); boost::posix_time::ptime ptx; check("trac 3608 /RTC no failbit set", !failure_test(ptx, value, facet5)); // proves failbit was not set check_equal("trac 3608 /RTC valid value", "2009-10-01T00:00:00", to_iso_extended_string(ptx)); } </pre><p> Built with -RTC1 and msvc-14.1 and no errors reported. </p> Ticket