summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-30 19:01:25 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-01-30 19:01:25 (GMT)
commit9da387342eea566659daed83c850220cee041059 (patch)
tree4ef05589271e0800fb5bf853bad09cd1c4dfeb7c /src/H5FD.c
parentd1f2eff23148da5e39463bd351be51767755b1c1 (diff)
downloadhdf5-9da387342eea566659daed83c850220cee041059.zip
hdf5-9da387342eea566659daed83c850220cee041059.tar.gz
hdf5-9da387342eea566659daed83c850220cee041059.tar.bz2
Added a free wrapper that lets us free constant pointers without
generating warnings. Also, brought the const-ness of the VOL connector info in line with the VFD info (not visible externally).
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 1a4ab4d..0cc5654 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -574,6 +574,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+H5_GCC_DIAG_OFF(cast-qual)
herr_t
H5FD_fapl_close(hid_t driver_id, const void *driver_info)
{
@@ -591,17 +592,19 @@ H5FD_fapl_close(hid_t driver_id, const void *driver_info)
/* Allow driver to free info or do it ourselves */
if(driver_info) {
if(driver->fapl_free) {
- if((driver->fapl_free)((void *)driver_info) < 0) /* Casting away const OK -QAK */
+ /* Free the const pointer (why we turn off the diagnostic) */
+ if((driver->fapl_free)((void *)driver_info) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed")
- } /* end if */
+ }
else
- driver_info = H5MM_xfree((void *)driver_info); /* Casting away const OK -QAK */
- } /* end if */
- } /* end if */
+ driver_info = H5MM_xfree_const(driver_info);
+ }
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_fapl_close() */
+H5_GCC_DIAG_ON(cast-qual)
/*-------------------------------------------------------------------------