Re: rootcint problems with 2.00.09 on Linux/egcs

From: stefan kluth (skluth@mh1.lbl.gov)
Date: Wed Jul 01 1998 - 22:40:22 MEST


On Wed, 1 Jul 1998, stefan kluth wrote:

> 
> Hi, 
> 
> after installing 2.00.09 for Linux/egcs I find that rootcint generates
> code which does not compile. I created two dictionary code files, one with
> 2.00.08 and one with 2.00.09 and diff'ed it. The differences coincide with
> the lines where the compiler flags errors. Here is an example:
> 
> dictionary code file made with rootcint 2.00.08 (compiles and works):
> 
> ...
> 
> static int G__AllJets_AllJets_2_0(G__value *result7,char *funcname,struct
> G__param *libp,int hash) {
>    AllJets *p=NULL;
>    switch(libp->paran) {
>    case 3:
>       p = new AllJets(
> *(HepConstAList<HepLorentzVector>*)libp->para[0].ref,*(AllJets::Algorithm*)
> libp->para[1].ref,*(int*)libp->para[2].ref);
> 
> ...
> 
> 
> dictionary code file made with rootcint 2.00.09:
> 
> ...
> 
> static int G__AllJets_AllJets_2_0(G__value *result7,char *funcname,struct
> G__param *libp,int hash) {
>    AllJets *p=NULL;
>    switch(libp->paran) {
>    case 3:
>       p = new AllJets( 
> *(HepConstAList<HepLorentzVector>*)libp->para[0].ref,
> libp->para[1].ref?*(AllJets::Algorithm*)libp->para[1].ref:
G__Mint(libp->para[1])
> ,libp->para[2].ref?*(int*)libp->para[2].ref:G__Mint(libp->para[2]));
> 
> ...
> 
> 
> The egcs g++ compiler says:
> AllJetsCint.cc: In function `int G__AllJets_AllJets_2_0(struct G__value *,
> char *, struct G__param *, int)':
> AllJetsCint.cc:371: no matching function for call to `AllJets::AllJets
> (HepConstAList<HepLorentzVector> &, int, int &)'
> 
> 
> The difference between rootcint for 2.00.08 and 2.00.09 seems to be that
> rootcint inserts logical expressions " ... ? ... : ... " instead of just
> casting and dereferencing pointers. This leads to the wrong argument types
> for the call of the constructor. 

And I forgot to say, that AllJets::Algorithm is a public enumeration of
class AllJets. The compiler only complains when the argument is expected
to be of type "AllJets::Algorithm", because in the  " ... ? ... : ... "
construct the 2nd possibility "G__Mint(libp->para[1])" appearently has the
wrong type, i.e. int, and in general the conversion int->enumeration is
not allowed. 

cheers, Stefan

---Stefan Kluth---------------Lynen Fellow----------------|\--|\-------
-  LBNL, MS 50A 2160       -  phone:  +1 510 495 2376  -  |/  |/      -
-  1 Cyclotron Rd.         -  fax:    +1 510 495 2957  -  |\/\|\/\|'  -
---Berkeley, CA94720, USA-----e-mail: SKluth@lbl.gov------|/\/|/\/|----



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:34 MET