Description of Problem: Version-Release number of selected component (if applicable): g++ 2.96-85 How Reproducible: Every time Steps to Reproduce: 1. Compile program with g++ -Wall testseek.cpp -o testseek 2. Run 3. Actual Results:seekp test Posn after 1st write : 1020 Posn after 1st move : 100 Posn after 2nd move : 100 Bad bit set Posn after 3rd move : 0 Expected Posn after 1st write : 1020 Posn after 1st move : 100 Posn after 2nd move : 300 Posn after 3rd move : 0 Results: Legacy code fails as seekp is not working Additional Information:
Created attachment 34423 [details] C++ file testing seekp
David, as I mentioned on enigma-list, I don't personally know C++ to know wether or not this is a bug, however, I have just confirmed the results above if that helps: pts/16 mharris@zod:~$ ./testseek seekp test Posn after 1st write : 1020 Posn after 1st move : 100 Posn after 2nd move : 100 Bad bit set Posn after 3rd move : 0 pts/16 mharris@zod:~$ rpm -qf /usr/bin/g++ gcc-c++-2.96-95 pts/0 mharris@halden:~$ ./testseek seekp test Posn after 1st write : 1020 Posn after 1st move : 100 Posn after 2nd move : 100 Bad bit set Posn after 3rd move : 0 pts/0 mharris@halden:~$ cat /etc/redhat-release Red Hat Linux release 7.2 (Enigma) pts/0 mharris@halden:~$ g++ -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98) Hope this helps.
Converting from non-standard "ostrstream" to standard "ostringstream" (header <sstream>) yields expected behaviour: $ rpm -q gcc-c++ gcc-c++-2.96-98 $ ./testseek2 seekp test2 Posn after 1st write : 1020 Posn after 1st move : 100 Posn after 2nd move : 300 Posn after 3rd move : 0 Or, using GCC3 and libstdc++ v3 yields expected behaviour in both cases, too: $ rpm -q gcc3-c++ gcc3-c++-3.0.1-3 $ ./testseek seekp test Posn after 1st write : 1020 Posn after 1st move : 100 Posn after 2nd move : 300 Posn after 3rd move : 0 $ ./testseek2 seekp test2 Posn after 1st write : 1020 Posn after 1st move : 100 Posn after 2nd move : 300 Posn after 3rd move : 0
Created attachment 42331 [details] C++ standard version of the example code, working fine
Ok in 3.2