Re: ROOTCINT problems with long long

From: gora@solar2.ucr.edu
Date: Thu Jul 22 1999 - 21:59:41 MEST


Dear Masaharu,
  Please have a nice vacation. Here are some further problems with long long
that you might look at when you come back. First of all, I had already tried
your suggestion of copying the library, but it does not work: I get a
segmentation fault, both with long long and with unsigned long long. Here is
the end of the trace produced with the -t option to root cint. The command
used was:
/usr/local/root/new/bin/rootcint -f GPIBDict.cxx -c -t GPIB.h GPIBLinkDef.h

Trace:
...
LOADING file=TObject.h:/usr/local/root/new/include/TObject.h:
LOADING file=TString.h:/usr/local/root/new/include/TString.h:
LOADING file=long.dl:/usr/local/root/new/cint/include/long.dl:
Segmentation fault

Please let me know if you need further details. I will try the updated version
of cint tomorrow.
  The other question I had was on how to test the handling of long long. The
gcc documentation says that usual integer arithmetic works with long long,
and the following simple check seems to be OK when compiled with gcc.

% cat lltest.cxx
#include <iostream.h>
#include <stdio.h>
int main()
{
 long long ill = 200;
 unsigned long long iull = 400;
 int i = ill;
 unsigned int j = iull;

 cout << (long) ill << ' ' << (long) iull << endl;
 printf("%d %u\n", i, j);
 return 1;
}

% g++ -O -o lltest lltest.cxx
% ./lltest
200 400
200 400

However, when I type in the following macro to cint, I get unexpected results
{
 #include <iostream.h>
 long long ill = 200;
 int i = ill;

 cout << (long) ill << endl;
 cout << i << endl;
}
cint prints out
200
134973880
i.e., it seems like there is a problem with changing between normal ints and
long long ints. Thanks in advance.
Regards,
Gora

MXJ02154@nifty.ne.jp writes:
>Dear Gora,
>
>I'll copy the new version today. 
>
>To support 'long long' in ROOT, you can simply copy 
>$CINTSYSDIR/incluce/long.dl to $ROOTSYS/cint/include/long.dl.
>However, it may not support 'unsigned long long' yet. 
>
>Masaharu Goto



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:36 MET