summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-07-10 03:15:36 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-07-10 03:15:36 (GMT)
commitdb7c43d375f6997dfc44d6153e7b015da571a8c9 (patch)
tree4f2c1e23d42540d4ea86870c29f11c217e2e566e /test/h5test.c
parent78e13fe8b09f4398519f58552d42651712284c76 (diff)
downloadhdf5-db7c43d375f6997dfc44d6153e7b015da571a8c9.zip
hdf5-db7c43d375f6997dfc44d6153e7b015da571a8c9.tar.gz
hdf5-db7c43d375f6997dfc44d6153e7b015da571a8c9.tar.bz2
Updates to warnhist script, along with a few cleanups, and add some comments
to warning cleanups that are a bit obscure.
Diffstat (limited to 'test/h5test.c')
-rw-r--r--test/h5test.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 99b2010..d83c6e7 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -190,6 +190,14 @@ h5_clean_files(const char *base_name[], hid_t fapl)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * sub_filename in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
void
h5_delete_test_file(const char *base_name, hid_t fapl)
{
@@ -239,6 +247,7 @@ h5_delete_test_file(const char *base_name, hid_t fapl)
return;
} /* end h5_delete_test_file() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------
@@ -1344,6 +1353,14 @@ h5_dump_info_object(MPI_Info info)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * temp in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
h5_stat_size_t
h5_get_file_size(const char *filename, hid_t fapl)
{
@@ -1445,12 +1462,14 @@ h5_get_file_size(const char *filename, hid_t fapl)
return(-1);
} /* end get_file_size() */
+#pragma GCC diagnostic pop
/*
* This routine is designed to provide equivalent functionality to 'printf'
* and allow easy replacement for environments which don't have stdin/stdout
* available. (i.e. Windows & the Mac)
*/
+H5_ATTR_FORMAT(printf, 1, 2)
int
print_func(const char *format, ...)
{
@@ -2016,7 +2035,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-const char *
+H5_ATTR_PURE const char *
h5_get_version_string(H5F_libver_t libver)
{
return(LIBVER_NAMES[libver]);