Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the function cast error in H5Dchunk.c and activate #1170

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions config/gnu-warnings/error-8
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# NOTE: src/ files are not compatible with these warnings as errors
# src/H5Dchunk.c
# -Werror=cast-function-type
-Wcast-function-type
-Werror=cast-function-type
#
# For GCC 8, promote maybe-initialized warnings to an error. GCC 8
# reports 0 maybe-uninitialized warnings where earlier versions
Expand Down
15 changes: 14 additions & 1 deletion src/H5Dchunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,19 @@ H5D__chunk_mem_xfree(void *chk, const void *_pline)
FUNC_LEAVE_NOAPI(NULL)
} /* H5D__chunk_mem_xfree() */

/*-------------------------------------------------------------------------
* Function: H5D__chunk_mem_free
*
* Purpose: Wrapper with H5MM_free_t-compatible signature that just
* calls H5D__chunk_mem_xfree and discards the return value.
*-------------------------------------------------------------------------
*/
static void
H5D__chunk_mem_free(void *chk, const void *_pline)
{
(void)H5D__chunk_mem_xfree(chk, _pline);
}

/*-------------------------------------------------------------------------
* Function: H5D__chunk_mem_realloc
*
Expand Down Expand Up @@ -4387,7 +4400,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, const
/* (delay allocating fill buffer for VL datatypes until refilling) */
/* (casting away const OK - QAK) */
if (H5D__fill_init(&fb_info, NULL, (H5MM_allocate_t)H5D__chunk_mem_alloc, (void *)pline,
(H5MM_free_t)H5D__chunk_mem_xfree, (void *)pline, &dset->shared->dcpl_cache.fill,
(H5MM_free_t)H5D__chunk_mem_free, (void *)pline, &dset->shared->dcpl_cache.fill,
dset->shared->type, dset->shared->type_id, (size_t)0, orig_chunk_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info")
fb_info_init = TRUE;
Expand Down