>g++ -v Reading specs from /pd/gcc/2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gcc version 2.95.2 19991024 (release) --------------------------- test.cpp ------------------------ #include <iostream> #include <strstream> using namespace std; int main( ) { char *tmp = "This is a test"; char tag[100]; tag[0] = '\0'; istrstream inputStream((const char*)tmp); inputStream >> tag; cout << tag << endl; } -------------------------------- Works ------------------------ > g++ test.cpp > ./a.out This -------------------------------- Crashes ---------------------- > g++ -malign-double test.cpp > ./a.out Segmentation fault -------------------------------- Cause ------------------------ The bit that causes the seg fault is "inputStream >> tag;"
The problem cannot be reproduce with gcc3.3.x and gcc3.4.1. Gcc 2.95.2 is *very* old and no longer maintained, please consider updating your tools.
Reopen ...
... to close as fixed.