summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-01-13 22:01:52 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-01-13 22:01:52 (GMT)
commit96cc43235ea92ea0f84623ad0be6d029a111c150 (patch)
tree1384024fa2dae51d58efc49f6a83c0fcad0555a8 /configure.in
parent4cd492dbb43c132df9d03cc19443d74eeb8503dd (diff)
downloadhdf5-96cc43235ea92ea0f84623ad0be6d029a111c150.zip
hdf5-96cc43235ea92ea0f84623ad0be6d029a111c150.tar.gz
hdf5-96cc43235ea92ea0f84623ad0be6d029a111c150.tar.bz2
[svn-r9819] Purpose: Bug fix
Description: The fix of the loss problem of the last 2 bytes of mantissa on sleipnir has not been successful. It happens when converting from unsigned long long to long double. The failure has been on and off. Solution: Hard set a macro to disable unsigned long long->long double for FreeBSD until a good solution is found to solve this elusive problem. Platforms tested: sleipnir and fuss. Only sleipnir is concerned. Misc. update:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in19
1 files changed, 10 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 898bd18..b9c3846 100644
--- a/configure.in
+++ b/configure.in
@@ -2768,29 +2768,30 @@ AC_CACHE_VAL([hdf5_cv_ullong_to_ldouble_precision_works],
unsigned long long l = 0xa601e80bda85fcefULL;
long double ld;
unsigned char *c1, *c2;
- int endian, size;
+ size_t size;
+ int endian;
int tst_value = 1;
- int i;
- int ret = 0;
+ int ret = 0;
/* Determine this system's endianess */
c1 = (unsigned char*)calloc(1, sizeof(int));
- memcpy(c1, &tst_value, sizeof(int));
+ memcpy((void*)c1, &tst_value, sizeof(int));
if(c1[0]==1)
endian = 0; /* little endian */
else
endian = 1; /* big endian */
- memset(&ld, 0, 12);
+ size = sizeof(long double);
+ memset(&ld, 0, size);
ld = (long double)l;
- size = sizeof(long double);
- c2 = (unsigned char*)malloc(size);
- memcpy(c2, &ld, size);
+ c2 = (unsigned char*)calloc(1, size);
+ memcpy((void*)c2, &ld, size);
/* Test if the last 2 bytes of mantissa are lost. Mainly for FreeBSD on Intel
* architecture(sleipnir) where it happens. */
- if(endian==0 && c2[0]==0 && c2[1]==0) /*little endian*/
+ /*if(endian==0 && c2[0]==0 && c2[1]==0)*/ /*little endian*/
+ if(endian==0 && c2[0]==0) /*little endian*/
ret = 1;
free(c1);