summaryrefslogtreecommitdiffstats
path: root/src/H5HF.c
diff options
context:
space:
mode:
authorvchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com>2022-01-04 23:23:33 (GMT)
committerGitHub <noreply@github.com>2022-01-04 23:23:33 (GMT)
commitd8ef511b2afac659b7aed3490fedc963b70785d8 (patch)
treedbd1d5bfc413ad6b49d9ca2179d369a64e6e9df0 /src/H5HF.c
parent5d453a6055b994978a3795ee2873bc4170bc576c (diff)
parenta30ca5afcd9f2e35b3a37f74286a6fe264b946f2 (diff)
downloadhdf5-d8ef511b2afac659b7aed3490fedc963b70785d8.zip
hdf5-d8ef511b2afac659b7aed3490fedc963b70785d8.tar.gz
hdf5-d8ef511b2afac659b7aed3490fedc963b70785d8.tar.bz2
Merge pull request #49 from vchoi-hdfgroup/feature/vfd_swmr
Feature/vfd swmr
Diffstat (limited to 'src/H5HF.c')
-rw-r--r--src/H5HF.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/H5HF.c b/src/H5HF.c
index 1f4cc26..6c6b101 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -117,8 +117,14 @@ H5HF__op_write(const void *obj, size_t obj_len, void *op_data)
{
FUNC_ENTER_PACKAGE_NOERR
- /* Perform "write", using memcpy() */
- H5MM_memcpy((void *)obj, op_data, obj_len); /* Casting away const OK -QAK */
+ /* Perform "write", using memcpy()
+ *
+ * We cast away const here because no obj pointer that was originally
+ * const should ever arrive here.
+ */
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
+ H5MM_memcpy((void *)obj, op_data, obj_len);
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HF__op_write() */
@@ -350,10 +356,15 @@ H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id /*out*/)
/* Check for 'huge' object */
if (size > hdr->max_man_size) {
- /* Store 'huge' object in heap */
- /* (Casting away const OK - QAK) */
+ /* Store 'huge' object in heap
+ *
+ * Although not ideal, we can quiet the const warning here becuase no
+ * obj pointer that was originally const should ever arrive here.
+ */
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
if (H5HF__huge_insert(hdr, size, (void *)obj, id) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'huge' object in fractal heap")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
} /* end if */
/* Check for 'tiny' object */
else if (size <= hdr->tiny_max_len) {