diff options
author | David Young <dyoung@hdfgroup.org> | 2019-11-05 18:14:26 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2019-11-05 18:14:26 (GMT) |
commit | 34eff2aae501e0276f58d2113c02d15b51fca7d8 (patch) | |
tree | ee23f90c1458653e680c2a1f088f8f6d071e2b95 /test | |
parent | afd4b291315e39e3966eadaf8ae9894b30e9504e (diff) | |
download | hdf5-34eff2aae501e0276f58d2113c02d15b51fca7d8.zip hdf5-34eff2aae501e0276f58d2113c02d15b51fca7d8.tar.gz hdf5-34eff2aae501e0276f58d2113c02d15b51fca7d8.tar.bz2 |
Change some GCC warnings to errors. Fix code to quiet some warnings.
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/cache.c | 2 | ||||
-rw-r--r-- | test/cache_tagging.c | 2 | ||||
-rw-r--r-- | test/null_vol_connector.c | 6 | ||||
-rw-r--r-- | test/tfile.c | 1 | ||||
-rw-r--r-- | test/tid.c | 25 | ||||
-rw-r--r-- | test/tvlstr.c | 4 |
7 files changed, 28 insertions, 14 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 57080aa..3a8a8a8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -61,7 +61,7 @@ TEST_PROG= testhdf5 \ dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \ external efc objcopy objcopy_ref links unlink twriteorder big mtime fillval mount \ flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \ - enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \ + getname vfd ros3 s3comms hdfs ntypes \ dangle dtransform reserved cross_read freespace mf vds file_image \ unregister cache_logging cork swmr vol diff --git a/test/cache.c b/test/cache.c index 1a726fa..e59dc3e 100644 --- a/test/cache.c +++ b/test/cache.c @@ -16926,7 +16926,7 @@ check_move_entry_errs(unsigned paged) { herr_t result; H5F_t * file_ptr = NULL; - H5C_t * cache_ptr = NULL; + H5C_t * cache_ptr; test_entry_t * entry_ptr = NULL; test_entry_t * entry_0_0_ptr; test_entry_t * entry_0_1_ptr; diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 7ce4e88..c3921ea 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -528,7 +528,7 @@ check_file_open_tags(hid_t fcpl, int type) hid_t fid = -1; /* File Identifier */ int verbose = FALSE; /* verbose file outout */ hid_t fapl = -1; /* File access prop list */ - haddr_t root_tag; /* Root Group Tag */ + haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */ haddr_t sbe_tag; /* Sblock Extension Tag */ /* Testing Macro */ diff --git a/test/null_vol_connector.c b/test/null_vol_connector.c index 5ed8545..64f62c4 100644 --- a/test/null_vol_connector.c +++ b/test/null_vol_connector.c @@ -116,6 +116,12 @@ static const H5VL_class_t null_vol_g = { NULL, /* optional */ NULL /* free */ }, + { /* blob_cls */ + NULL, /* put */ + NULL, /* get */ + NULL, /* specific */ + NULL /* optional */ + }, NULL /* optional */ }; diff --git a/test/tfile.c b/test/tfile.c index 4fb2bc9..3525ec0 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1057,6 +1057,7 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count"); + fprintf(stderr, "fid1: %zd datasets, %zd groups, %zd datatypes, %zd attributes\n", H5Fget_obj_count(fid1, H5F_OBJ_DATASET), H5Fget_obj_count(fid1, H5F_OBJ_GROUP), H5Fget_obj_count(fid1, H5F_OBJ_DATATYPE), H5Fget_obj_count(fid1, H5F_OBJ_ATTR)); oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); @@ -19,6 +19,13 @@ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" +static herr_t +free_wrapper(void *p) +{ + free(p); + return SUCCEED; +} + /* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { @@ -69,7 +76,7 @@ static int basic_id_test(void) goto out; /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, free_wrapper); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -163,7 +170,7 @@ static int basic_id_test(void) H5E_END_TRY /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, free_wrapper); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -238,7 +245,7 @@ out: /* A dummy search function for the next test */ -static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; } +static int test_search_func(void H5_ATTR_UNUSED * ptr1, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED * ptr2) { return 0; } /* Ensure that public functions cannot access "predefined" ID types */ static int id_predefined_test(void ) @@ -264,7 +271,7 @@ static int id_predefined_test(void ) goto out; H5E_BEGIN_TRY - testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); + testPtr = H5Isearch(H5I_GENPROP_LST, test_search_func, testObj); H5E_END_TRY CHECK_PTR_NULL(testPtr, "H5Isearch"); @@ -492,7 +499,7 @@ static int test_id_type_list(void) H5I_type_t testType; int i; /* Just a counter variable */ - startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + startType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(startType, H5I_BADID, "H5Iregister_type"); if(startType == H5I_BADID) goto out; @@ -507,7 +514,7 @@ static int test_id_type_list(void) /* Create types up to H5I_MAX_NUM_TYPES */ for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -516,7 +523,7 @@ static int test_id_type_list(void) /* Wrap around to low type ID numbers */ for(i = H5I_NTYPES; i < startType; i++) { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -524,7 +531,7 @@ static int test_id_type_list(void) /* There should be no room at the inn for a new ID type*/ H5E_BEGIN_TRY - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, free_wrapper); H5E_END_TRY VERIFY(testType, H5I_BADID, "H5Iregister_type"); @@ -533,7 +540,7 @@ static int test_id_type_list(void) /* Now delete a type and try to insert again */ H5Idestroy_type(H5I_NTYPES); - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, free_wrapper); VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); if(testType != H5I_NTYPES) diff --git a/test/tvlstr.c b/test/tvlstr.c index 731270c..cc01084 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -861,12 +861,12 @@ static void test_write_same_element(void) hid_t file1, dataset1; hid_t mspace, fspace, dtype; hsize_t fdim[] = {SPACE1_DIM1}; - char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"}; + const char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"}; hsize_t marray[] = {NUMP}; hsize_t coord[SPACE1_RANK][NUMP]; herr_t ret; - char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."}; + const char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."}; file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file1, FAIL, "H5Fcreate"); |