Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2006-06-14 03:01:20


Daniel Krügler ha escrito:

> Hello,
>
> Since introduction of VC 8, boost::format causes an assertion failure,
> if empty strings are provided as format arguments, e.g.
>
> std::string arg;
> boost::format frmt("%s"); // Alternatively use: "%1%"
> std::string res = (frmt % arg).str();
>
> This defect is well known since end of 2005 (e.g. by Mick Hollins et al.
> in the thread
>
> "[Boost.Format] empty string argument causes VC 8.0 to assert"
>
> or by J.S.Otis in the thread
>
> "Assertion failure usign boost::format with Visual C++ 2005"
>
> The defect was well-analyzed by Caleb Epstein and I share his opinion,
> that this is due to a defect in boost::io::detail::mk_str, which
> provides a null pointer as argument to std::string::append, which
> violates its preconditions. The null pointer effectively is a result of
> some streambuf::pbase() call, which is allowed to return a null result
> under well-defined conditions.
>
> My question is: Has this error been fixed since then?
>
> Thanks in advance,
>

Daniel, my hunch is that Boost.Format is not being actively maintained,
so whether this is fixed or not pretty much depends on individual
contributions. Do you feel qualified to write, test and propose a patch?
If so, please submit such a patch to the list and I (or someone else with
CVS write access) can commit it.

Best regards,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net