simple program crashes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have this simple program:

#include <sstream>
int main(void) {
        int i;
        std::ostringstream buf;
        //buf.width(2);
        buf.fill('0');
        return 0;
}

I compile/link it using: g++ a.cc
and then execute: ./a.out

But the program crashes - 
Bus Error (core dumped)

Using: gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/specs
Configured with: ../configure --disable-nls --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/ld
Thread model: posix
gcc version 3.3


The problem occurs if any variable is declared before ostringstream, if
ostringstream is defined first, the program runs fine.
What could cause this problem?
Thanks..
m.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux