summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-07-11 17:28:02 (GMT)
committerGitHub <noreply@github.com>2022-07-11 17:28:02 (GMT)
commite269f9036474b9d5b3c88d865e7bb20ecad5c54c (patch)
treeaa5313f198b044605d6b135cd4499cc2f91eacee /tools/src
parent0412d3f292b255da700d865fd1eb990e05c038bb (diff)
downloadhdf5-e269f9036474b9d5b3c88d865e7bb20ecad5c54c.zip
hdf5-e269f9036474b9d5b3c88d865e7bb20ecad5c54c.tar.gz
hdf5-e269f9036474b9d5b3c88d865e7bb20ecad5c54c.tar.bz2
Misc clang warning fixes (#1869)
* Minor clang warning fixes in src and test * Fixes clang warnings in high-level library * clang format-nonliteral warning fixes * Committing clang-format changes * Fixed int -> float clang cast warnings in h5diff * Quiets some warnings in flex/bison generated code * Suppress overlong string warning for libinfo on clang Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/h5import/h5import.c30
-rw-r--r--tools/src/h5perf/pio_perf.c2
-rw-r--r--tools/src/h5perf/sio_engine.c2
-rw-r--r--tools/src/h5perf/sio_perf.c2
-rw-r--r--tools/src/misc/h5repart.c2
5 files changed, 31 insertions, 7 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 317db81..9da348a 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -91,6 +91,8 @@ main(int argc, char *argv[])
const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n";
const char *err10 = "Length of output file name limited to 255 chars.\n";
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
+
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -236,6 +238,8 @@ main(int argc, char *argv[])
if (process(opt) == -1)
goto err;
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
+
for (i = 0; i < opt->fcount; i++) {
in = &(opt->infiles[i].in);
if (in->sizeOfDimension)
@@ -364,6 +368,8 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
const char *err11 = "Error in reading string data.\n";
int retval = -1;
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
+
/*-------------------------------------------------------------------------
* special case for opening binary classes in H5_HAVE_WIN32_API
* "FP" denotes a floating point binary file,
@@ -450,13 +456,15 @@ processDataFile(char *infile, struct Input *in, hid_t file_id)
goto error;
}
+ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
+
/* Set success return value */
retval = 0;
error:
if (strm)
HDfclose(strm);
- return (retval);
+ return retval;
}
static int
@@ -1429,10 +1437,12 @@ processConfigurationFile(char *infile, struct Input *in)
const char *err19 = "Unable to get integer value.\n";
const char *err20 = "Unable to get subset values.\n";
- /* create vector to map which keywords have been found
- check vector after each keyword to check for violation
- at the end check vector to see if required fields have been provided
- process the output file according to the options
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
+
+ /* - create vector to map which keywords have been found
+ * - check vector after each keyword to check for violation
+ * - at the end check vector to see if required fields have been provided
+ * - process the output file according to the options
*/
/* Initialize machine endian */
@@ -2429,13 +2439,15 @@ processConfigurationFile(char *infile, struct Input *in)
}
}
+ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
+
/* Set success return value */
retval = 0;
error:
if (strm)
HDfclose(strm);
- return (retval);
+ return retval;
}
static int
@@ -4610,6 +4622,8 @@ process(struct Options *opt)
"Error in creating the output data set. Dataset with the same name may exist at the specified path\n";
const char *err6 = "Error in writing the output data set.\n";
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
+
H5E_BEGIN_TRY
{
if ((file_id = H5Fopen(opt->outfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) {
@@ -4742,8 +4756,10 @@ process(struct Options *opt)
} /* STR */
+ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
+
H5Fclose(file_id);
- return (0);
+ return 0;
}
uint16_t
diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c
index 2e82dd4..5f09e15 100644
--- a/tools/src/h5perf/pio_perf.c
+++ b/tools/src/h5perf/pio_perf.c
@@ -1087,7 +1087,9 @@ output_report(const char *fmt, ...)
va_list ap;
HDva_start(ap, fmt);
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
HDvfprintf(output, fmt, ap);
+ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
HDva_end(ap);
}
}
diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c
index 7781f80..eff5f61 100644
--- a/tools/src/h5perf/sio_engine.c
+++ b/tools/src/h5perf/sio_engine.c
@@ -1298,7 +1298,9 @@ do_cleanupfile(iotype iot, char *filename)
if (driver == H5FD_FAMILY) {
for (j = 0; /*void*/; j++) {
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
HDsnprintf(temp, temp_sz, filename, j);
+ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
if (HDaccess(temp, F_OK) < 0)
break;
diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c
index 6da073a..2a0db61 100644
--- a/tools/src/h5perf/sio_perf.c
+++ b/tools/src/h5perf/sio_perf.c
@@ -647,7 +647,9 @@ output_report(const char *fmt, ...)
va_list ap;
HDva_start(ap, fmt);
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
HDvfprintf(output, fmt, ap);
+ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
HDva_end(ap);
}
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index 078883d..89be169 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -151,6 +151,7 @@ get_size(const char *progname, int *argno, int argc, char *argv[])
*
*-------------------------------------------------------------------------
*/
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
int
main(int argc, char *argv[])
{
@@ -507,3 +508,4 @@ main(int argc, char *argv[])
HDfree(buf);
return EXIT_SUCCESS;
} /* end main */
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")