Hi Pierre-Luc,
Thanks for reporting this problem. It is now fixed in the CVS repository.
Cheers,
Philippe
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
On Behalf Of Pierre-Luc Drouin
Sent: Wednesday, October 26, 2005 4:45 PM
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] Strange problem with the interpreter
It looks like I have found a strange problem with the interpreter. Here are 3 script files where I initialize a TString or a TString array in different locations. The third script file makes root to crash:
First script file, initialization of a TString outside the test function
//////////////////////////////////////////////////////////
void test();
TString a="test";
void test()
{
cout << a.Data() << endl;
}
//////////////////////////////////////////////////////////
Output from root:
root [0] .x test.C
test
root [1] .q
Second script file, initialization of a TString array inside the test2
function
//////////////////////////////////////////////////////////
void test2();
void test2()
{
TString a[2]={"test","test"};
cout << a[0].Data() << endl;
}
//////////////////////////////////////////////////////////
Output from root:
root [0] .x test2.C
test
root [1] .q
Thirs script file, initialization of a TString array outside the test3
functon
//////////////////////////////////////////////////////////
void test3();
TString a[2]={"test","test"};
void test3()
{
cout << a[0].Data() << endl;
}
//////////////////////////////////////////////////////////
Output from root:
root [0] .x test3.C
root [1] .q
So it looks like that the TString array is not initialized outside the function or that it is not initialized correctly. I get this error with both 4.04/02f running on Linux 2.4.20 and 5.05/01 running on FreeBSD Received on Thu Oct 27 2005 - 23:07:00 MEST
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET