summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-02-19 17:25:44 (GMT)
committerGitHub <noreply@github.com>2021-02-19 17:25:44 (GMT)
commit0a2a385accd2fc18c17bc3e36fd38f6a802e38df (patch)
treeeaa89ebb07d35516fb188b84e7a329e9a3a85bab /tools
parenta6f1b6ce5398102c579821f5f6589b00e552d6d0 (diff)
downloadhdf5-0a2a385accd2fc18c17bc3e36fd38f6a802e38df.zip
hdf5-0a2a385accd2fc18c17bc3e36fd38f6a802e38df.tar.gz
hdf5-0a2a385accd2fc18c17bc3e36fd38f6a802e38df.tar.bz2
Fixed uninitialized warnings (#360)
* Fixed all -Wsometimes-uninitialized warnings by initializing variables * Fixed all -Wconditional-uninitialized warnings by initializing variables * Commit alignment changes from running bin/format_source with clang version 10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools.c2
-rw-r--r--tools/src/h5ls/h5ls.c2
-rw-r--r--tools/src/misc/h5debug.c4
-rw-r--r--tools/src/misc/h5repart.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index f6566d9..3b78491 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1778,7 +1778,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
} break;
case H5T_ARRAY: {
int k, ndims;
- hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts;
+ hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts = 0;
hid_t memb = H5I_INVALID_HID;
H5TOOLS_DEBUG("H5T_ARRAY");
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index f718bde..09bc323 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -2648,7 +2648,7 @@ int
main(int argc, const char *argv[])
{
hid_t file_id = H5I_INVALID_HID;
- char * fname = NULL, *oname = NULL, *x;
+ char * fname = NULL, *oname = NULL, *x = NULL;
const char * s = NULL;
char * rest;
int argno;
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index e95919f..454981d 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -246,8 +246,8 @@ main(int argc, char *argv[])
haddr_t extra[10];
uint8_t sig[H5F_SIGNATURE_LEN];
size_t u;
- H5E_auto2_t func;
- void * edata;
+ H5E_auto2_t func = NULL;
+ void * edata = NULL;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t status = SUCCEED;
int exit_value = 0;
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index 77b40a1..a75f6d8 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -97,7 +97,7 @@ static off_t
get_size(const char *progname, int *argno, int argc, char *argv[])
{
off_t retval = -1;
- char *suffix;
+ char *suffix = NULL;
if (isdigit((int)(argv[*argno][2]))) {
retval = HDstrtol(argv[*argno] + 2, &suffix, 10);