From 14559ac4bd689a3b63ea578da617821e89e6427f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 28 Apr 2020 08:10:57 -0500 Subject: Correct -Werror=unused-variable --- c++/src/H5Library.cpp | 2 +- c++/src/H5Location.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 3813b79..6cf89ae 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -82,7 +82,7 @@ void H5Library::close() //-------------------------------------------------------------------------- void H5Library::dontAtExit() { - herr_t ret_value = H5dont_atexit(); + (void)H5dont_atexit(); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index c62437c..d95b39e 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -1068,7 +1068,7 @@ void H5Location::link(const char *curr_name, const H5Location& new_loc, hid_t lcpl_id = lcpl.getId(); hid_t lapl_id = lapl.getId(); - ret_value = H5Lcreate_hard(getId(), curr_name, new_loc.getId(), new_name, lcpl_id, lapl_id); + ret_value = H5Lcreate_hard(getId(), curr_name, new_loc_id, new_name, lcpl_id, lapl_id); if (ret_value < 0) throwException("link", "creating link failed"); } -- cgit v0.12 From eb89227c341024152437da798577611aa5a9a453 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 28 Apr 2020 08:43:24 -0500 Subject: Add -Werror= flags to lists displayed in libhdf5.settings. --- src/libhdf5.settings.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index 5b65d77..b6e7221 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -40,7 +40,7 @@ Languages: H5_CPPFLAGS: @H5_CPPFLAGS@ AM_CPPFLAGS: @AM_CPPFLAGS@ C Flags: @CFLAGS@ - H5 C Flags: @H5_CFLAGS@ + H5 C Flags: @H5_CFLAGS@ @H5_ECFLAGS@ AM C Flags: @AM_CFLAGS@ Shared C Library: @enable_shared@ Static C Library: @enable_static@ @@ -59,7 +59,7 @@ Languages: C++: @HDF_CXX@ @BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CXX_VERSION@ @BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CXXFLAGS@ -@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ +@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ @H5_ECXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ Shared C++ Library: @enable_shared@ @BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: @enable_static@ -- cgit v0.12 From 80ffb0783a8ce541125e7fa8aca13efd8764bd6e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 28 Apr 2020 09:15:48 -0500 Subject: Fix -Werror=unused-variable --- c++/test/tarray.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 0af2c4f..3653b32 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -47,7 +47,7 @@ typedef enum int_t { INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, INT_OTHER } int_t; - + /*------------------------------------------------------------------------- * Function: test_array_compound_array * @@ -211,7 +211,7 @@ static void test_array_compound_array() // Verify the compound datatype info CompType ctype_check(base_type.getId()); base_type.close(); - + // Check the number of members nmemb = ctype_check.getNmembers(); verify_val(nmemb, 2, "ctype_check.getNmembers", __LINE__, __FILE__); @@ -277,7 +277,7 @@ static void test_array_compound_array() } // end test_array_compound_array() - + /*------------------------------------------------------------------------- * Function: test_array_assignment * @@ -298,11 +298,11 @@ static void test_array_compound_array() */ H5::DataType getArr() { - hsize_t *dims = new hsize_t; - *dims = 5; - H5::ArrayType ret; - ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); - delete[] dims; + hsize_t *dims = new hsize_t; + *dims = 5; + H5::ArrayType ret; + ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); + delete[] dims; return ret; } static void test_array_assignment() @@ -349,7 +349,7 @@ static void test_array_assignment() } } // end test_array_assignment() - + /*------------------------------------------------------------------------- * Function: test_array_info * @@ -372,7 +372,6 @@ static void test_array_info() s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; // Information to write hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; - int nmemb; // Number of compound members int ii; // counting variables hsize_t idxi, idxj, idxk; // dimension indicing variables H5T_class_t mclass; // Datatype class for field @@ -469,7 +468,7 @@ static void test_array_info() } // end test_array_info() - + /**************************************************************** ** ** test_array(): Main datatypes testing routine. @@ -492,7 +491,7 @@ void test_array() } // test_array() - + /*------------------------------------------------------------------------- * Function: cleanup_array * -- cgit v0.12 From 1dd7e1cd11d6acedf3e84a965784ced181e5d235 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 28 Apr 2020 10:56:40 -0500 Subject: More fixes for unused variable --- c++/test/dsets.cpp | 3 ++- c++/test/tarray.cpp | 1 + c++/test/tattr.cpp | 2 +- c++/test/tcompound.cpp | 1 + c++/test/tdspl.cpp | 1 + c++/test/testhdf5.cpp | 4 ++++ c++/test/tfile.cpp | 4 +--- c++/test/tfilter.cpp | 1 + c++/test/th5s.cpp | 1 + c++/test/tobject.cpp | 3 ++- c++/test/trefer.cpp | 1 + c++/test/ttypes.cpp | 1 + c++/test/tvlstr.cpp | 1 + 13 files changed, 18 insertions(+), 6 deletions(-) diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 0a187ef..acdb8af 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -35,7 +35,8 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; -#include "h5cpputil.h" // C++ utilility header file +#include "h5test.h" +#include "h5cpputil.h" // C++ utilility header file const H5std_string FILE1("dataset.h5"); const H5std_string DSET_DEFAULT_NAME("default"); diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index 3653b32..6fceb5b 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -29,6 +29,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file const H5std_string FILENAME("tarray.h5"); diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 25b5ff8..80c02b6 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -30,6 +30,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file const H5std_string FILE_BASIC("tattr_basic.h5"); @@ -1134,7 +1135,6 @@ static void test_attr_mult_read() static void test_attr_delete() { H5std_string attr_name; // Buffer for attribute names - int ii; // Output message about test being performed SUBTEST("Removing Attribute Function"); diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index ce2d061..7eb61ac 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -29,6 +29,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file /* Number of elements in each test */ diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index 0a60a86..a712e21 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -30,6 +30,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file const H5std_string FILENAME("tdatatransform.h5"); diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index b998f76..1fd268a 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -51,6 +51,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file int @@ -121,5 +122,8 @@ Comment out tests that are not done yet */ if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) TestCleanup(); + /* Release test infrastructure */ + TestShutdown(); + return (GetTestNumErrs()); } diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index d5278d5..4567bef 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -33,6 +33,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file const hsize_t F1_USERBLOCK_SIZE = (hsize_t)0; @@ -850,9 +851,6 @@ static void test_file_info() // Output message about test being performed SUBTEST("File general information"); - hsize_t out_threshold = 0; // Free space section threshold to get - hbool_t out_persist = FALSE;// Persist free-space read - try { // Create a file using default properties. H5File tempfile(FILE7, H5F_ACC_TRUNC); diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 2e3c07c..522e19d 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -32,6 +32,7 @@ #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file #define DSET_DIM1 100 diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index 18cd460..dcf4d4c 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -35,6 +35,7 @@ #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file #include "H5srcdir.h" // srcdir querying header file diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 5d2f15f..e18839f 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -29,6 +29,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file const H5std_string FILE_OBJECTS("tobjects.h5"); @@ -336,6 +337,7 @@ static void test_open_object_header() // Create a group in the root group Group grp(file1.createGroup(GROUPNAME)); + grp.close(); // Commit the type inside the file IntType dtype(PredType::NATIVE_INT); @@ -354,7 +356,6 @@ static void test_open_object_header() // Close dataset, dataspace, and group dset.close(); dspace.close(); - grp.close(); // Now make sure that openObjId can open all three types of objects hid_t obj_grp = file1.openObjId(GROUPNAME); diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 9f43054..930e523 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -28,6 +28,7 @@ #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file // File names diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 161b1c4..ce42b09 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -29,6 +29,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file /* diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index d5f2afe..f089ec9 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -31,6 +31,7 @@ using std::endl; #include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" // C++ utilility header file // Data file used in most test functions -- cgit v0.12