From 6ced6457c3048bd10bf6f470b329b4810d9be826 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 28 Jun 2019 19:26:47 -0500 Subject: Move the -Wformat-nonliteral warning to the developer flags. Fix bugs I introduced in the last commit. --- config/gnu-flags | 7 +++++-- src/H5FL.c | 2 +- test/tsohm.c | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index ced54c9..fc3a6ce 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -113,9 +113,11 @@ case "$cc_vendor-$cc_version" in # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it from the # environment variable at configure time. + # NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add + # it to the developer flags. H5_CFLAGS="$H5_CFLAGS $arch -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align" H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" - H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" + H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default" # As of GCC 8.x, the -Wunsafe-loop-optimizations has been removed @@ -150,7 +152,8 @@ case "$cc_vendor-$cc_version" in esac # Developer warnings (suggestions from gcc, not code problems) - DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn" + # NOTE: -Wformat-nonliteral added back in here (from being disabled in H5_CFLAGS) + DEVELOPER_WARNING_CFLAGS="-Winline -Waggregate-return -Wmissing-format-attribute -Wmissing-noreturn -Wformat-nonliteral" NO_DEVELOPER_WARNING_CFLAGS="-Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn" # Symbols diff --git a/src/H5FL.c b/src/H5FL.c index a849ff7..9ed867d 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -1430,7 +1430,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) HDassert(head->init); /* Get the pointer to the info header in front of the block to free */ - temp = (H5FL_arr_list_t *)((void *)((unsigned char *)obj - -sizeof(H5FL_arr_list_t))); /*lint !e826 Pointer-to-pointer cast is appropriate here */ + temp = (H5FL_arr_list_t *)((void *)((unsigned char *)obj - sizeof(H5FL_arr_list_t))); /*lint !e826 Pointer-to-pointer cast is appropriate here */ /* Get the number of elements */ free_nelem=temp->nelem; diff --git a/test/tsohm.c b/test/tsohm.c index 99df6b7..9216b3e 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -950,7 +950,6 @@ test_sohm_size1(void) } /* test_sohm_size1 */ -#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */ /*--------------------------------------------------------------------------- * Function: test_sohm_size_consistency_open_create -- cgit v0.12