egcs Bug Report

Stephan Trebs dtrebs@t-online.de
Fri Sep 10 08:24:00 GMT 1999


Hallo! 

I can´t believe it! Is there´s a bug in the C++ Standard Libraries?

Bye,
	Stephan
-- 
                           _____
__________      _____________  /_
__  ___/_ | /| / /  _ \  _ \  __/ 	Stephan Trebs <sweet@gmx.net>
_(__  )__ |/ |/ //  __/  __/ /_  	studcom.urz.uni-halle.de/~aeca7
/____/ ____/|__/ \___/\___/\__/
//
// Bug Report
// Stephan Trebs <sweet@gmx.net>

// Compiler   : egcs 2.91.66
// Arguments  : none
// System     : Pentium II 266, Linux 2.2.5 (SuSE 6.1)
// Description: The string a "remembers" at pos 2 on parts of its data
//	        at pos 1 when I use a.data()
// Note	      : To get this effect the string at pos 1 has to be longer
//              than the string at pos 2
//              When I change the string in an Qt 1.44 QString there are
//              no problems.
#include <string>
 int main()
 {
 string a;
 // position 1
 a="22";
 cout << "22 as (string): "<<a <<"       as (char *):"<<a.data() << endl;
 // position 2
 a="1";
 cout << " 1 as (string): "<<a << "        as (char *):"<< a.data() << endl;
 return 0;
 }



More information about the Gcc-bugs mailing list