[ROOT] CINT bug ?

From: Patois Yannick (patois@ganil.fr)
Date: Tue May 08 2001 - 13:35:52 MEST


Hi,

The following code doesnt work for me.

Class Ta only has one member function 'void Bugged(double x)' which
simply apply successively 2 conditions on x, returning when x lower than
15 and above 80.
But when instancied and called, even when x is between those 2 limits
CINT return before the next part of the method.
The code works as expected when compiled (g++).

<<<< bug.C
#ifndef __CINT__
#include <stdio.h>
#endif
class TA {
public:
  void Bugged(const double x) const; };
void TA::Bugged(const double x) const {
  printf("x:%f\n",x);
  if (x<15           ) return;
  if (x>80           ) return;
  int    i   = 0;        // Removing this line solve the problem
  printf("OK x:%f\n",x); // This line is never reached
}
void bug() {
  TA a;
  for (int i=0;i<10;i++) a.Bugged(i*10);}
#ifndef __CINT__
main() { bug(); }
#endif
>>>>

Interpreted output:

root [3] .x bug.C
x:0.000000
x:10.000000
x:20.000000
x:30.000000
x:40.000000
x:50.000000
x:60.000000
x:70.000000
x:80.000000
x:90.000000


Compiled:
$ g++ bug.C
$ ./a.out
x:0.000000
x:10.000000
x:20.000000
OK x:20.000000
x:30.000000
OK x:30.000000
x:40.000000
OK x:40.000000
x:50.000000
OK x:50.000000
x:60.000000
OK x:60.000000
x:70.000000
OK x:70.000000
x:80.000000
OK x:80.000000
x:90.000000


I use ROOT version 3.00.06 from the binary version for Intel Linux RH
6.1 (I'm using a Mdk 6.1 with some upgrades).

Thanx for any informations.

	Yannick



This archive was generated by hypermail 2b29 : Fri Jun 08 2001 - 11:51:24 MEST