Re: [ROOT] RE:CINT: extra destructor called

From: Nick van Eijndhoven (Nick@phys.uu.nl)
Date: Thu Aug 09 2001 - 09:39:39 MEST


Hi Christoph,
You can at anytime use

gROOT->ProcessLine(".O0");

                            Cheers,
                             Nick.

-- 
Dr. Nick van Eijndhoven mailto:nick@phys.uu.nl http://www.phys.uu.nl/~nick
--------------------------------------------------------------------------
Org.:    Utrecht University/Nikhef, Department of Subatomic Physics
Address: P.O. Box 80.000, NL-3508 TA Utrecht, The Netherlands
Phone:   +31-30-2532331(direct) +31-30-2531492(secr.)  Fax: +31-30-2518689
NIKHEF:  +31-20-5922178(direct) +31-20-5922000(secr.)  Fax: +31-20-5925155
CERN:    +41-22-7679751(direct) +41-22-7675857(secr.)  Fax: +41-22-7679480
Offices: Buys Ballot lab. 710 (Utrecht)   N241 (Nikhef)   B23 1-020 (CERN)
--------------------------------------------------------------------------


Christoph Bugel wrote:
> 
> Thank you for the tip :)
> I activated the optimization 0 like this:
> 
> G__init_cint("cint -O0");
> G__loadfile("test.cc");
> G__calc("func();");
> 
> and it fixed the problem.
> Is it possible to turn this option on at a later time (not during G__init_cint)
> with something like G__process_cmd, or similar? (I think with G__calc and
> G__exec_text I can use only C++ syntax, not commands)
> 
> Thanks,
> Christoph
> 
> On Wed 2001-08-08, Masaharu Goto wrote:
> > Hello Christoph,
> >
> > Thank you for reporting this problem.
> > It turned out that this is a tricky one. I need time to
> > think about this. Meanwhile, a workaround is to use optimization
> > level 0 '.O0' to turn off bytecode compilation.
> >
> > Thank you
> > Masaharu Goto
> >
> >
> > >Date: Mon, 6 Aug 2001 16:02:58 +0300
> > >From: Christoph Bugel <chris@tti-telecom.com>
> > >To: roottalk@pcroot.cern.ch, rootdev@pcroot.cern.ch
> > >Subject: CINT: extra destructor called
> > >
> > >Hi!
> > >I found a bug in cint, causing it to call a destructor where it
> > >shouldnt.  For example, the code below will produce this output:
> > >
> > >DTOR
> > >CTOR
> > >DTOR
> > >
> > >This was tested with cint-5.15.07.
> > >BTW, when 'i' is initialized to 3, the output will be 'DTOR' which is
> > >also wrong. If 'i' is initialized to 0 it works ok. (CTOR, DTOR).
> > >Thanks!
> > >
> > >here is the code:
> > >
> > >/////////////////////////////////////
> > >
> > >class X
> > >{
> > >       public:
> > >       X(){ printf("CTOR\n"); }
> > >       ~X(){ printf("DTOR\n"); }
> > >};
> > >void bug()
> > >{
> > >       int i=0;
> > >       while(i<5)
> > >       {
> > >               if(i==1)
> > >               {
> > >                       X x1;
> > >               }
> > >               i = i + 1;
> > >       }
> > >}
> > >



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:56 MET