RE:Re: ROOTCINT problems with long long

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Fri Jul 30 1999 - 16:14:57 MEST


Dear Gora,


>  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 versio
n
>of cint tomorrow.

This is an interesting problem. Will you send me GPIB.h and GPIBLinkDef.h?


About following 'long long' questions, 
I tried several compilers and it seems like many of them still have problem
with 'long long'. There are many missing capability for 'long long' in cint
and this is because I took the mininum subset of what is possible on multiple
compilers. I know g++ can support more functionality, but at this moment, I
am not supporting it.

I try to change the wrapper class implementation

Thank you
Masaharu Goto

============================================================================
  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



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