rootcint and char **b; *b=x;

Masaharu Goto (MXJ02154@niftyserve.or.jp)
Thu, 08 Jan 1998 23:07:00 +0900


Fons,

>First of all, all my best wishes for 1998!!
Thanks and same to you.

I have 3 questions to answer today.

1) Assignment problem f(char **b) { *b = 'c'; }
This was a bug. I fixed it. Following program works under cint5.13.40.

=========================================================
#include <stdlib.h>
void assign(char *a, char **b) { *b = a; }
int main() {
char *a = "test";
char *b = NULL;
assign(a,&b);
puts(a);
puts(b);
return 0;
}

2) rootcint difference alpha vs others

>I checked also independently that rootcint generates different code
>on linux and alpha. For example in case of the Root class THtml
>the difference between the dictionary generated on hpux or linux
>with the one generated on alpha/unix is the following.

Yes, Alpha-CXX version is different from other platforms. Alpha-g++ version
is identical to other platforms. Difference is in src/newlink.c line 41
and platform/alpha_cxx.root line 24. G__DECCXX macro is defined.
I found strange problem under Alhpa-CXX when I visited CERN last March.
Alpha-CXX linker complains that there are multiple _builtin_delete
functions when building precompiled library. If G__DECCXX is not defined
'static void operator delete(void *p);' is defined in the dictionary
source code. It looks like this was the source of problem. Defining
G__DECCXX will eliminate static delete operator and generates slightly
different code.
If you don't like this, delete G__DECCXX macro in platform/alpha_cxx.root
and re-install ROOT/CINT. Difference will go away. It everything work
fine under this condition, you can use this configuration.

3) DEC Alpha /usr/include/standards.h

Following message is also about rootcint on Alpha, but seems like a
different problem. What is happening is , in /usr/include/standards.h
there aer some DEC-Alpha specific symbols , like _BEGIN_CPLUSPLUS,
which can not be parsed by rootcint. You need to avoid reading
/usr/include/standards.h in rootcint session. If it is explicitly
included in user's header file, use #ifndef __CINT__

#ifndef __CINT__
#include <standards.h>
#endif

If it is implicitly included by system include file, things are
litte more complicated. I need to see header files.

+P and -p option are for 'makecint' , different version of rootcint.
These option invokes C/C++ preprocessor before parsing. But for rootcint,
you can not use these options. So please ignore.

>Greetings ROOTers!
>
>In order to take advantage of the huge speed boost of
>the ALPHA, I've tried to port my 3 classes from my
>Intel Linux to the OSF v4.0 Alpha. While the .h and
>.cxx for the classes compile just fine, the rootcint
>gives me a wierd error (and then proceeds to try and
>compile the rqmd_dict.cxx file):
>
>~~~~~~~~~~~ROOTCINT ERROR MESSAGE
>Generating dictionary ...
>Error: Unexpected EOF G__fgetstream():2 FILE:/usr/include/standards.h
>LINE:257
>Advice: You may need to use +P or -p option
>Limitation: can not handle macro _BEGIN_CPLUSPLUS extern"C"{/ Use +P
>or -p option
>FILE:/usr/include/standards.h LINE:257
>g++ -O -D__osf__ -D__alpha -I/usr/local/Root/include
>-I/usr/local/lib/g++-include -c rqmd_dict.cxx
>/usr/local/Root/include/TMemberInspector.h: In function `void
>G__set_cpp_environmentrqmd_dict(...)':
>In file included from rqmd_dict.cxx:19:
>/usr/local/Root/include/TMemberInspector.h:34: field
>`G__set_cpp_environmentrqmd_dict(...)::TMemberInspector::fgIsA' in
>local class cannot be static
>In file included from rqmd_dict.cxx:20:
>/usr/local/Root/include/TError.h:40: parse error before string
>constant
>rqmd_dict.cxx:22: parse error at end of input
>*** Exit 1
>Stop.

P.S.
About STL,
Reverse and find algorithm worked on array, vector<T> and list<T>
container.

Masaharu Goto