summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Harten <pharten@ncsa.uiuc.edu>1999-03-08 19:02:43 (GMT)
committerPaul Harten <pharten@ncsa.uiuc.edu>1999-03-08 19:02:43 (GMT)
commit169754fb4cc42a0bdd56be610d6a9d40f9d9e331 (patch)
tree2c5260e0bc37f17b8560a01595879cad78371922 /src
parent596c1905e80fd5518f28e97951113359edad43df (diff)
downloadhdf5-169754fb4cc42a0bdd56be610d6a9d40f9d9e331.zip
hdf5-169754fb4cc42a0bdd56be610d6a9d40f9d9e331.tar.gz
hdf5-169754fb4cc42a0bdd56be610d6a9d40f9d9e331.tar.bz2
[svn-r1119] Purpose:
Bug fix Problem: On Solaris2.5, once the library has been compilied with any type of optimization, a bus error comes up in the "dtypes" test. Solution: The problem appears to be in the compilers' version of memcpy() that is used when optimized. Instead of substituting HDmemmove(), on Solaris, the problem is also taken care of by preparing the second argument to HDmemcpy(). The datatype pointer is copied to a separate char pointer which is then used as the second argument to HDmemcpy(). For some reason, it isn't enough to simply cast the datatype pointer. Platform tested: Solaris2.5
Diffstat (limited to 'src')
-rw-r--r--src/H5Tconv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 711c0ec..f340674 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -270,6 +270,7 @@ static intn interface_initialize_g = 0;
hbool_t s_mv, d_mv; /*move data to align it? */ \
size_t dt_size=sizeof(DT); /*needed by CI_END macro */ \
H5T_conv_hw_t *priv = cdata->priv; /*private data */ \
+ char *nonaligned; /*temporary char pointer */ \
\
switch (cdata->command) { \
case H5T_CONV_INIT: \
@@ -305,8 +306,9 @@ static intn interface_initialize_g = 0;
if (d_mv) priv->d_aligned += nelmts; \
for (elmtno=0; elmtno<nelmts; elmtno++, DIR src, DIR dst) { \
if (s_mv) { \
- /*Memmove() instead of memcpy() for solaris' sake*/ \
- HDmemmove(&aligned, src, sizeof(ST)); \
+ /*temporary char pointer for solaris' sake*/ \
+ nonaligned = (char*)src; \
+ HDmemcpy(&aligned, nonaligned, sizeof(ST)); \
s = (ST*)&aligned; \
} else { \
s = src; \