Boost logo

Boost :

From: mysticdevil_at_[hidden]
Date: 2006-01-13 19:59:13


Hi,

This code: boost::format("%1%") % "";
on Visual C++ 2005 with the following call stack:

msvcp80d.dll!std::_Debug_message
msvcp80d.dll!std::_Debug_pointer<char>
msvcp80d.dll!std::basic_string<char,std::char_traits<cha
        r>,std::allocator<char> >::_Inside
msvcp80d.dll!std::basic_string<char,std::char_traits<cha
        r>,std::allocator<char> >::append
MyApp.exe!boost::io::detail::mk_str<char,std::char_trait
        s<char>,std::allocator<char> >
MyApp.exe!boost::io::detail::put<char,std::char_traits<c
        har>,std::allocator<char>,char const (&)[1]>
MyApp.exe!boost::io::detail::distribute<char,std::char_t
        raits<char>,std::allocator<char>,char const
(&)[1]>
MyApp.exe!boost::io::detail::feed<char,std::char_traits<
        char>,std::allocator<char>,char const (&)[1]>
MyApp.exe!boost::basic_format<char,std::char_traits<char
>,std::allocator<char> >::operator%<char const
[1]>
 
Produces the following assert message: invalid null
pointer

Because at >
TheStockGuy.exe!boost::io::detail::mk_str<char,std::char
_traits<char>,std::allocator<char> >
it's called the
std::basic_string<char,std::char_traits<cha
r>,std::allocator<char> >::append function with
arguments NULL and 0
[Basically that library makes this call:
String.append(NULL, 0); wich is invalid by ISO C++.]

Mystic Devil


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk