Boost logo

Boost Users :

From: Filipe Sousa (natros_at_[hidden])
Date: 2004-11-22 06:48:57


Hi!

I get a segmentation fault with Intel compiler 8.1 using the fallowing code

#include <boost/format.hpp>
#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
locale_facets.h:4528
#2 0x0805517f in boost::io::detail::wrap_isdigit (c=49 '1', os=& { ... }) at
parsing.hpp:36
#3 0x0805509b in boost::io::detail::wrap_scan_notdigit (beg= { ... }, end=
{ ... }, os=& { ... }) at parsing.hpp:46
#4 0x08054f7b in boost::io::detail::upper_bound_from_fstring (buf=& { ... },
arg_mark=37 '%', os=& { ... }, exceptions=-1 '\377') at parsing.hpp:351
#5 0x0804d33a in basic_format<char,std::char_traits<char> >::parse
(this=0xbffff480, buf=& { ... }) at parsing.hpp:377
#6 0x0804ceab in basic_format<char,std::char_traits<char> >::basic_format
(this=0xbffff480, str=0x80572a8 "writing %1%, x=%2% : %3%-th try") at
format_implementation.hpp:37
#7 0x0804d02c in basic_format<char,std::char_traits<char> >::basic_format
(this=0xbffff480, =<no value>) at format_implementation.hpp:38
#8 0x0804a41c in main () at test.cc:5
#9 0x4102e7f8

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?

My system: Debian, boost-1.31.0, gcc-3.4.2, Intel compiler 8.1

--
Filipe Sousa



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