ACLiC fatal error when using /* */ to comment code out


I encountered the following problem in Root 5.32.00, compiling my code using ACLiC.
I wrote a simple class which runs over a root file and copies information to a smaller root file for rapid analysis purposes. The code compiled and worked fine. I progressively added branches to the tree in the small file without any problem, until recently.
I added the private data member float topPt. Here is the error message when I tried to compile:

Fatal: sizeof(::makeTree) == sizeof(::ROOT::Shadow::makeTree) violated at line 172 of `/afs/’

followed by a stack trace (also attached).
I’ve attached the files. I apologize for the length of the code, however when I comment sections out I am not able to reproduce the error.
The problem is in this line:

bool /*sameFlavorLeptons,*/ inZwindow;

The file makeTree_C_ACLiC_dict.cxx (also attached) contains this line:

bool* inZwindow;

If I remove the comment in front of inZwindow, the code compiles. The variable inZwindow was being assigned as bool* instead of bool, and this is somehow linked to the number of member declarations after inZwindow. If the topPt declaration is commented out (using // !), the code again compiles. Another way to avoid the error is to instead make topPt a public member of the class.

I’ll stick to // to comment code out, this solved the problem. But can someone tell me why there is no error with fewer data members, or when topPt is made public instead than private?

Thanks very much,

stacktrace.txt (4 KB)
makeTree_C_ACLiC_dict.cxx (114 KB)
makeTree.h (4.84 KB)
makeTree.C (29.2 KB)

I think that reason of thi error is simpe, instead od doing this

you should do this

inZwindow should be a pointer.

Hi Daniel,

I could change inZwindow to a pointer, but I don’t want to change the variable’s type.
I’m more interested in figuring out why the parsing error occurs. I think this line is valid C++, and it only produces the error if a certain number of variables are declared afterwards. This is what I’d like to understand.


Hi Gala,

It is a bug in CINT that mistake the ‘*’ used for the comment as part of the type … This problem will be solved once we switch to Cling.