From dc23d6f1548148c5a96120e0f80964b957a4530b Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 14 Jun 2023 09:47:20 -0400 Subject: [PATCH] Fixed various -Wunused-variable warnings Some of these the compiler is now able to identify thanks to the previous fixes of -Wmissing-variable-declarations warnings, making the variables static. Others are variables that look useful to inspect in the debugger, and so I just cast to void to suppress the warnings. --- c++/examples/h5tutr_extend.cpp | 1 + c++/examples/readdata.cpp | 2 ++ examples/h5_vds-exc.c | 2 +- examples/h5_vds-exclim.c | 2 +- examples/h5_vds.c | 2 +- test/mount.c | 2 +- tools/lib/h5tools.c | 1 - 7 files changed, 7 insertions(+), 5 deletions(-) diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp index b725f008375..071fcb07be1 100644 --- a/c++/examples/h5tutr_extend.cpp +++ b/c++/examples/h5tutr_extend.cpp @@ -113,6 +113,7 @@ main(void) // Get information to obtain memory dataspace. rank = filespace->getSimpleExtentNdims(); herr_t status_n = filespace->getSimpleExtentDims(dimsr); + (void)status_n; if (H5D_CHUNKED == prop.getLayout()) rank_chunk = prop.getChunk(rank, chunk_dimsr); diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 1deed36a8c0..65893192f14 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -85,6 +85,7 @@ main(void) */ H5std_string order_string; H5T_order_t order = intype.getOrder(order_string); + (void)order; cout << order_string << endl; /* @@ -110,6 +111,7 @@ main(void) */ hsize_t dims_out[2]; int ndims = dataspace.getSimpleExtentDims(dims_out, NULL); + (void)ndims; cout << "rank " << rank << ", dimensions " << (unsigned long)(dims_out[0]) << " x " << (unsigned long)(dims_out[1]) << endl; diff --git a/examples/h5_vds-exc.c b/examples/h5_vds-exc.c index fa6b720ee77..7653280b91e 100644 --- a/examples/h5_vds-exc.c +++ b/examples/h5_vds-exc.c @@ -49,7 +49,7 @@ main(void) kdims[3] = {KDIM0, KDIM1, KDIM2}, kdims_max[3] = {H5S_UNLIMITED, KDIM1, KDIM2}, ndims[3] = {NDIM0, NDIM1, NDIM2}, ndims_max[3] = {H5S_UNLIMITED, NDIM1, NDIM2}, start[3], /* Hyperslab parameters */ - stride[3], count[3], block[3]; + count[3], block[3]; hsize_t start_out[3], stride_out[3], count_out[3], block_out[3]; int k = 2; int n = 3; diff --git a/examples/h5_vds-exclim.c b/examples/h5_vds-exclim.c index 58ed1f848c8..30ccf92fa56 100644 --- a/examples/h5_vds-exclim.c +++ b/examples/h5_vds-exclim.c @@ -48,7 +48,7 @@ main(void) herr_t status; hsize_t vdsdims[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, kdims[3] = {KDIM0, KDIM1, KDIM2}, ndims[3] = {NDIM0, NDIM1, NDIM2}, start[3], /* Hyperslab parameters */ - stride[3], count[3], block[3]; + count[3], block[3]; hsize_t start_out[3], stride_out[3], count_out[3], block_out[3]; int k = 2; int n = 3; diff --git a/examples/h5_vds.c b/examples/h5_vds.c index ceb4956ebd1..96bd8a2bdc6 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -55,7 +55,7 @@ main(void) hsize_t vdsdims[2] = {VDSDIM0, VDSDIM1}, /* Virtual datasets dimension */ dims[1] = {DIM0}, /* Source datasets dimensions */ start[2], /* Hyperslab parameters */ - stride[2], count[2], block[2]; + count[2], block[2]; hsize_t start_out[2], stride_out[2], count_out[2], block_out[2]; int wdata[DIM0], /* Write buffer for source dataset */ rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */ diff --git a/test/mount.c b/test/mount.c index 0aee49f9fc7..09ce35e8aa2 100644 --- a/test/mount.c +++ b/test/mount.c @@ -27,7 +27,7 @@ static const char *FILENAME[] = {"mount_1", "mount_2", "mount_3", "mount_4", "mo #define NX 4 #define NY 5 #define NAME_BUF_SIZE 40 -static int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */ +static int bm[NX][NY]; /* Data buffers */ /*------------------------------------------------------------------------- * Function: setup diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 49d88af0697..285d2bb4166 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -51,7 +51,6 @@ int region_output; /* region output */ int oid_output; /* oid output */ int data_output; /* data output */ int attr_data_output; /* attribute data output */ -static int compound_data; unsigned packed_bits_num; /* number of packed bits to display */ unsigned packed_data_offset; /* offset of packed bits to display */