summaryrefslogtreecommitdiffstats
path: root/src/H5FDmulti.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-07-03 04:43:45 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-07-03 04:43:45 (GMT)
commit3b594992d6b062cf350d3f03e4b5c5d27b83a245 (patch)
tree42392ac76ff26413e3aee3989d60658189e2b57b /src/H5FDmulti.c
parentd0bc570c2cdc4cbbb42cc1d4dac61aba67e20892 (diff)
downloadhdf5-3b594992d6b062cf350d3f03e4b5c5d27b83a245.zip
hdf5-3b594992d6b062cf350d3f03e4b5c5d27b83a245.tar.gz
hdf5-3b594992d6b062cf350d3f03e4b5c5d27b83a245.tar.bz2
Add support for GCC9, update warnhist script, and clean up warnings.
Diffstat (limited to 'src/H5FDmulti.c')
-rw-r--r--src/H5FDmulti.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 6cfef55..b1d3430 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -771,7 +771,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
buf += nseen*2*8;
if (H5Tconvert(H5T_STD_U64LE, H5T_NATIVE_HADDR, nseen*2, x, NULL, H5P_DEFAULT)<0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1)
- ap = (haddr_t*)x;
+ ap = (haddr_t*)((void *)x);
UNIQUE_MEMBERS(map, mt) {
memb_addr[_unmapped] = *ap++;
memb_eoa[_unmapped] = *ap++;
@@ -1955,6 +1955,14 @@ compute_next(H5FD_multi_t *file)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() call with
+ * tmp 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"
static int
open_members(H5FD_multi_t *file)
{
@@ -1972,7 +1980,8 @@ open_members(H5FD_multi_t *file)
/* Note: This truncates the user's filename down to only sizeof(tmp)
* characters. -QK & JK, 2013/01/17
*/
- sprintf(tmp, file->fa.memb_name[mt], file->name);
+ snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name);
+ tmp[sizeof(tmp) - 1] = '\0';
H5E_BEGIN_TRY {
file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF);
@@ -1987,6 +1996,7 @@ open_members(H5FD_multi_t *file)
return 0;
}
+#pragma GCC diagnostic pop
#ifdef _H5private_H