public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* simple program crashes
@ 2003-09-04  7:54 m.
  0 siblings, 0 replies; only message in thread
From: m. @ 2003-09-04  7:54 UTC (permalink / raw)
  To: gcc-help

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-04  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-04  7:54 simple program crashes m.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).