I'm confused about the sizeof Long_t. I'm running ROOT:
* Version 2.25/03 15 September 2000 *
and g++ gives:
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
In Rtypes.h there is code:
#ifdef R__B64
typedef int Seek_t; //File pointer
typedef long Long_t; //Signed long integer 4 bytes
typedef unsigned long ULong_t; //Unsigned long integer 4 bytes
#else
typedef int Seek_t; //File pointer
typedef long Long_t; //Signed long integer 8 bytes
typedef unsigned long ULong_t; //Unsigned long integer 8 bytes
#endif
Here Long_t is always typedef'd to "long" even when long isn't 8 bytes.
The only difference between these two parts is the comments. I thought
Long_t was intended to be a uniform size (8 bytes) in a platform
independent manner -- just like Int_t is 4 bytes even when "int" isn't.
But even if it isn't the comments are exactly backwards; R__B64
*isn't* defined for this platform so the second block is the relevant one.
But there the comments say one should expect a 8 byte Long_t when it isn't.
-robert
Robert W. Hatcher | rhatcher@slac.stanford.edu
Research Associate | 650.926.3171 [FAX 4001 or 3587]
Stanford University | PO Box 4349, MS #63, Stanford CA 94309
============ test_sizeof.C ======================
#ifndef __CINT__
#include <iostream.h>
#endif
void test_sizeof()
{
#ifdef R__B64
cout << "R__B64 is defined " << endl;
#else
cout << "R__B64 is not defined " << endl;
#endif
cout << "sizeof(char) " << sizeof(char) << endl;
cout << "sizeof(Char_t) " << sizeof(Char_t) << endl;
cout << "sizeof(short) " << sizeof(short) << endl;
cout << "sizeof(Short_t) " << sizeof(Short_t) << endl;
cout << "sizeof(int) " << sizeof(int) << endl;
cout << "sizeof(Int_t) " << sizeof(Int_t) << endl;
cout << "sizeof(long) " << sizeof(long) << endl;
cout << "sizeof(Long_t) " << sizeof(Long_t) << endl;
cout << "sizeof(float) " << sizeof(float) << endl;
cout << "sizeof(Float_t) " << sizeof(Float_t) << endl;
cout << "sizeof(double) " << sizeof(double) << endl;
cout << "sizeof(Double_t) " << sizeof(Double_t) << endl;
#ifndef __CINT__
cout << "sizeof(long long) " << sizeof(long long) << endl;
#else
cout << "CINT doesn't recognize 'long long' by default " << endl;
#endif
}
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:36 MET