Long array identifiers

rootcint crashes given that you use a long array name (>=160 chars).

An minimal exaple:
error.h

#ifndef error_h
#define error_h

#include <TSelector.h>

class error : public TSelector {
public :
int 
LongName00120016002000240028003200360040004400480052005600600064006800720076008000840088009200960100010401080112011601200124012801320136014001440148015201560160[5];
   
   error(TTree * /*tree*/ =0) { }
   virtual ~error() { }

   ClassDef(error,0);
};

#endif

error.C

#define error_cxx
#include "error.h"

error_linkdef.h

#ifdef __CINT__
#pragma link C++ class error;
#endif

Then, I get the following:

~$ rootcint -v -f error_dict.C -c error.h error_linkdef.h
Segmentation fault

Of course, what one can do is putting a

#if !defined(__CINT__) && !defined(__MAKECINT__) ... #endif
around the long array variables – but rootcint shouldn’t segfault in the first place. Especially because the file with long names is generated automatically (using tree->MakeSelector()) and it is just additional work(*) every time you recreate the file.

(I’m using ROOT 5.14 and 5.18, both segfault)

(*) by the way, I also have to add

#include <string>
#include <vector>   
using std::string;
using std::vector;

to the header file created by MakeSelector().

Hi,

there are several static buffer sizes in CINT. Rather than adding workarounds or hundreds of buffer size checks we will replace these static sized buffers with dynamic strings in the coming months.

Until then please use one of the workarounds you already found yourself.

Cheers, Axel.

[quote]Especially because the file with long names is generated automatically (using tree->MakeSelector())[/quote]As another work around, could you try to use MakeProxy instead?

Cheers,
Philippe