CINT array limitation


I seemed to be hitting a CINT limitation with arrays that I can’t figure out how to slove (see example below).

If I reduce the dimension of acc by one (remove [NMC] for eg) then it compiles just fine.

How do I get around this ?


static const int NGEN=3;
static const int NTL=4;
static const int NJB=8;
static const int NMC=10;

void dum(int D[NGEN][NTL][NMC],int acc[NGEN][NTL][NJB][NMC]){


.L test.C+g
Info in <TUnixSystem::ACLiC>: creating shared library /Users/anyes/MyWork/Analysis/Code/myMacro/Xs/./
Cint internal error ary parameter dimension :0:
Warning: Error occurred during dictionary source generation
!!!Removing /Users/anyes/MyWork/Analysis/Code/myMacro/Xs/./tmp_0_LV5wJy.cxx /Users/anyes/MyWork/Analysis/Code/myMacro/Xs/./tmp_0_LV5wJy.h !!!
Error: rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity
/Users/anyes/MyWork/Analysis/Code/myMacro/Xs/./test.C:7: warning: unused parameter 'D'
/Users/anyes/MyWork/Analysis/Code/myMacro/Xs/./test.C:7: warning: unused parameter 'acc'
Info in <ACLiC>: The compiler has not found any problem with your macro.
        Probably your macro uses something rootcint can't parse.
        Check []( for Cint's limitations.


Cint can only handle <=3 dimensional arrays as function parameters. You can cast your array to e.g. a int*, define dum(int*, int*), and cast it back within dum.

We will try to remove this limitation during the coming months.

Cheers, Axel.

Did you plan to remove this limitation? Seems it is still valid in 2012. Thanks in advance.

Try the “typedef” trick: Multidimensional Array

Indeed, it looks fine. However, it would be better if it is not needed to use that trick (if there is no array limitation) :smiley:

Well, I’m sure that this problem has been “fixed” in the ROOT trunk. O:)
CINT has been removed completely (in ROOT 6). :mrgreen: