Strange Cint error

From: Tom Roberts <tjrob_at_fnal.gov>
Date: Fri, 11 Mar 2011 11:54:48 -0600


I am trying to get a large macro to work (>2000 lines of C++) in both compiled and macro modes (~100X speed up when compiled). Until yesterday it was macro only; to get it to compile I had to add lots of #include-s, re-arrange the order of some class definitions, and clean up a few minor things, but no logic changes.

It works fine when compiled:

        root -l HistoRoot.C+

But fails as a macro:

	root -l HistoRoot.C
	Error: strrchr param[0]=0 must not be 0

I traced the error message to this code - fails if STUB is defined (filename is a const char * argument of the enclosing function; this is the only use of strrchr in the file):

//#define STUB
#ifdef STUB

         const char *name = strrchr(filename,'/');
#else //STUB

         const char *name=0;
         name = strrchr(filename,'/');

#endif //STUB

In compile (+) mode it opens its GUI window correctly, and the entire macro works properly. In macro mode, it does not open the GUI window, and calling the HistoRoot() function manually does nothing (no error).

Any suggestions?

Tom Roberts Received on Fri Mar 11 2011 - 18:54:53 CET

This archive was generated by hypermail 2.2.0 : Fri Mar 18 2011 - 11:50:01 CET