Filipe Sousa wrote:
Hi!
I get a segmentation fault with Intel compiler 8.1 using the fallowing code
#include
#include <iostream> int main() { std::cout << boost::format("writing %1%, x=%2% : %3%-th try") % "toto" % 40.23 % 50 << std::endl; return 0; }
(idb) bt #0 0x0804aba8 in ctype<char>::is (this=0x41016b50, __m=2048, __c=49 '1') #at ctype_inline.h:40 #1 0x08051d55 in std::isdigit (__c=49 '1', __loc=& { ... }) at
The same code works perfectly with gcc-3.4.2 under linux. Is this a bug in boost format library or a Intel compiler problem?
The segfault takes place inside the compiler's standard library functions,
so it seems like the bug is in icc. Segfaulting inside isdigit is not a
conformant behaviour :)
Though, that might be the result of a binary link problem, or a strange
thing going on.
Did you try calling std::isdigit directly, on facets constructed the way
format constructs them ?
the facet object is coming from those lines :
#if !defined(BOOST_NO_STD_LOCALE)
const std::ctype<Ch> & fac = BOOST_USE_FACET( std::ctype<Ch>,
getloc());
#else
io::basic_oaltstringstream