Hi,
I just changed to Redhat entrprise WS 3.0 (please do not ask why), which ships with gcc 3.2.3 and foudn a very peculiar behaviour in cint, when using cout. I am using root 3.10.02.
This is what happens:
root [0] cout << "piet"
Error: operator- not defined for basic_ostream<char,char_traits > FILE:(tmpfile) LINE:1
*** Interpreter error recovered ***
As you see, there is not operator- in my line of code at all. My suspicion is that it has to do with the fact that cout evaluates to something negative:
root [1] cout
(ostream)(-1233911264)
I realise that it is prbably not easy for you to reproduce this error (it would have been discovered already if it were), so I played a bit with the debugger. Since the whole thing is rather comples, I did not try to understand it completely, but I thought that my experience might be helpfull to you, so please find some selecetd debugging output below.
I really hope you can have a look at this, because switching back to redHat 8 or so will be a major upheaval for me. If you want me to provide any more information, please ask and I will be happy to provide it.
Thanks,
Marco.
So here is the debugger output. I hope you can detremine from it whther it treats the minus sign correctly. I only put a breakpoint at G__getexpr. After some initial poarsing (i.e. several calls to G__getexpr), I get:
Breakpoint 1, G__getexpr (expression=0xbffedbd4 “_$u00_1_M-1233911264”)
at cint/src/expr.c:1090
As you can see, it contains the number -1233911264 (pointer?), which refers to cout.
Inside G__getexpr, G__wrap_plusminus and G__getitem are called:
1282 G__wrap_plusminus(c,G__OPR_SUBASSIGN,G__OPR_PREFIXDEC,G__OPR_POSTF
IXDEC);
(gdb) s
G__getitem (item=0xbffec270 “_$u00_1_M”) at cint/src/expr.c:2001
I do not knwo what the exact result of these manipulations is, but the next call to G__getexpr is:
Breakpoint 1, G__getexpr (expression=0xbffe7c24 “(int)1233911264”)
at cint/src/expr.c:1090
1090 int sp=0; /* stack pointer */
(gdb) c
Continuing.
And here are the remaining calls to G__getexpr, with the final error message.
Breakpoint 1, G__getexpr (expression=0xbffe2984 “1233911264”)
at cint/src/expr.c:1090
1090 int sp=0; /* stack pointer */
(gdb) c
Continuing.
Breakpoint 1, G__getexpr (expression=0xbffe7c24 “_$u00_1_P0”)
at cint/src/expr.c:1090
1090 int sp=0; /* stack pointer */
(gdb) c
Continuing.
Breakpoint 1, G__getexpr (expression=0xbffe7d24 “(int)1233911264”)
at cint/src/expr.c:10901090 int sp=0; /* stack pointer */
(gdb) c
Continuing.
Breakpoint 1, G__getexpr (expression=0xbffe2984 “1233911264”)
at cint/src/expr.c:1090
1090 int sp=0; /* stack pointer */
(gdb) c
Continuing.
(1) Error: operator- not defined for basic_ostream<char,char_traits > FILE:(tmpfile) LINE:1
Breakpoint 1, G__getexpr (expression=0xbffedcd4 “(char*)0x891655c”)
at cint/src/expr.c:1090