RE: rootcint problem

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 05 Jul 2005 09:40:35 -0500


Hi,

The issue is (as you noted) with the casting operator. Currently CINT does not support casting operator well (the problem you uncoverd is one of the issue, but they are also not always correctly used in the execution of scripts).

We are likely to tackle these issues in 2006 once we have replaced the current CINT in-memory dictionary (which will also allow the use of gcc_xml are the header file parser).

In the meantime, please hide this function from CINT:

#ifndef __CINT__

   operator Tester*() const {

        static Tester test;
        return &test;

    }
#endif

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Clark McGrew
Sent: Saturday, July 02, 2005 11:50 AM
To: RootTalk mailing list
Subject: [ROOT] rootcint problem

Hello All,

I've run into a problem with ROOT 4.00.08 being used with GCC 3.3.6 in a corner case of the handling of templates. I'm sorry, but I haven't checked in later versions.

The problem seems to originate from how ROOTCINT handles sub-classes defined inside of a template. I've attached a short example.

In the example, the CINT dictionary was generated using:

rootcint -f THandle_Dict.cxx -c -p THandle.hxx THandle_LinkDef.h

The problematic line is in THandle_Dict.cxx:

static int G__THandle_Dict_143_2_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {

   G__letint(result7,85,(long)((const
THandle<TObject>*)(G__getstructoffset()))->operator Tester*());

   return(1 || funcname || hash || result7 || libp) ; }

I believe the correct code is:

static int G__THandle_Dict_143_2_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {

   G__letint(result7,85,(long)((const
THandle<TObject>*)(G__getstructoffset()))->operator THandle<TObject>::Tester*());

   return(1 || funcname || hash || result7 || libp) ; }

Thanks,
Clark

-- 
Clark McGrew                    Univ. at Stony Brook, Physics and Astronomy
<clark.mcgrew_at_stonybrook.edu>   631-632-8299
Received on Tue Jul 05 2005 - 16:41:39 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:10 MET