diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-08-01 16:18:18 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-08-01 16:18:18 (GMT) |
commit | 1ae6daaa807f2bfd63076215950d9c412bfa08d7 (patch) | |
tree | d60f5aa4158d275f953561b47089add1ea76ecd2 /hl/src | |
parent | 0a64f3e8106a1ced78ae7c4a6744b3509d7ca0fc (diff) | |
download | hdf5-1ae6daaa807f2bfd63076215950d9c412bfa08d7.zip hdf5-1ae6daaa807f2bfd63076215950d9c412bfa08d7.tar.gz hdf5-1ae6daaa807f2bfd63076215950d9c412bfa08d7.tar.bz2 |
Sync with develop
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5IM.c | 3 | ||||
-rw-r--r-- | hl/src/H5LT.c | 16 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.l | 1 |
3 files changed, 16 insertions, 4 deletions
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 2a7ed9b..6f7414b 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -274,7 +274,8 @@ herr_t H5IMget_image_info( hid_t loc_id, return -1; /* Try to find the attribute "INTERLACE_MODE" on the >>image<< dataset */ - has_attr = H5LT_find_attribute(did, "INTERLACE_MODE"); + if ((has_attr = H5LT_find_attribute(did, "INTERLACE_MODE")) < 0) + goto out; /* It exists, get it */ if(has_attr == 1) diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index d63776d..a631533 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1407,12 +1407,18 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_ * *------------------------------------------------------------------------- */ - +/* H5Literate wants a non-const pointer but we have a const pointer in the API + * call. It's safe to ignore this because we control the callback, don't + * modify the op_data buffer (i.e.: dset_name) during the traversal, and the + * library never modifies that buffer. + */ +H5_GCC_DIAG_OFF(cast-qual) herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) { return H5Literate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name); } +H5_GCC_DIAG_ON(cast-qual) /*------------------------------------------------------------------------- * @@ -2032,12 +2038,18 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name ) * *------------------------------------------------------------------------- */ - +/* H5Aiterate wants a non-const pointer but we have a const pointer in the API + * call. It's safe to ignore this because we control the callback, don't + * modify the op_data buffer (i.e.: attr_name) during the traversal, and the + * library never modifies that buffer. + */ +H5_GCC_DIAG_OFF(cast-qual) herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) { return H5Aiterate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, find_attr, (void *)attr_name); } +H5_GCC_DIAG_ON(cast-qual) /*------------------------------------------------------------------------- diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index f16455b..5015053 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -26,7 +26,6 @@ /* Turn off suggest const & malloc attribute warnings in gcc */ #if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" #endif int my_yyinput(char *, int); |