Subject: [Boost-bugs] [Boost C++ Libraries] #3876: %T format specifier with local_time_facet crashes with MSVC 9
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-29 11:09:15
#3876: %T format specifier with local_time_facet crashes with MSVC 9
--------------------------+-------------------------------------------------
Reporter: Claudio Bley | Owner: az_sw_dude
Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: date_time
Version: Boost 1.41.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
The following program crashes with MSVC9 when trying to write the
local_date_time to the stringstream:
{{{
#!cpp
#include <boost/date_time/local_time/local_time.hpp>
#include <iostream>
#include <string>
#include <sstream>
int
main()
{
using namespace boost::posix_time;
using namespace boost::local_time;
time_zone_ptr utc;
local_date_time now(microsec_clock::universal_time(), utc);
local_time_facet* output_facet = new local_time_facet();
local_time_input_facet* input_facet = new local_time_input_facet();
std::stringstream ss;
ss.imbue(std::locale(std::locale::classic(), output_facet));
ss.imbue(std::locale(ss.getloc(), input_facet));
//
http://www.boost.org/doc/libs/1_41_0/doc/html/date_time/date_time_io.html#date_time.format_flags
// %T ! The time in 24-hour notation (%H:%M:%S)
output_facet->format("%T");
ss << now; // crash in _Strftime_l
}
}}}
With MinGW 4.4.0 it just ignores the %T format specifier. What's the deal
with %T?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3876> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC