(VERY Red faced). That is on OS X that there is a difference: 32 Bit: sizeof(int): 4 sizeof(long): 4 sizeof(long long): 8
64 Bit sizeof(int): 4 sizeof(long): 8 sizeof(long long): 8 Again, sorry for the confusion. Trying to keep it all straight is confusing. Over the years I have just stayed away from "long" where absolutely possible. ___________________________________________________________ Mike Jackson Principal Software Engineer BlueQuartz Software Dayton, Ohio [email protected] www.bluequartz.net On Dec 2, 2011, at 8:39 AM, Andrea Parenti wrote: > > Dear Mike, > > I am sorry to contradict what you say, but what I get is > sizeof(int) == sizeof(long) == 4 > compiling on Windows 7 (64 bits) with Visual Studio 2008. The data type size > is the same when I compile a 64-bit executable and a 32-bit executable. > In order to have an 8-byte variable I must use long long, in fact I get > sizeof(long long) == 8 > > But maybe this is compiler dependent (I'm not an expert of Visual Studio, I > usually work on Linux). > > Andrea > > ------------------------------------------------------------ > Dr. Andrea Parenti DESY (FS-EC Group) > > mail: [email protected] Notkestrasse 85 > web: http://www.desy.de/~parenti/ D-22607 Hamburg > phone: +49 (0)40 8998 3154 Germany > ------------------------------------------------------------ > > > On Thu, 1 Dec 2011, Michael Jackson wrote: > >> That is ONLY valid on 32 bit windows. On 64 bit windows long is 8 bytes in >> length. The use of "long" should just be banned, IMHO. >> ___________________________________________________________ >> Mike Jackson Principal Software Engineer >> BlueQuartz Software Dayton, Ohio >> [email protected] www.bluequartz.net >> >> On Dec 1, 2011, at 9:53 AM, Andrea Parenti wrote: >> >>> (ie just inverting the order from INT - LONG - LONG LONG to LONG LONG - >>> LONG - INT.) In this way ssize_t is of type long and there is no conflict >>> with ImageMagick. And I think there is no real change in HDF5 too, since >>> sizeof(int)==sizeof(long). > > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
