summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-11-22 20:23:07 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:19:37 (GMT)
commit0e7dffc0dd751ab69fea3d8e1f9c7a69d417eeae (patch)
tree6c55647da9867b867c67eef54b4a4b7b05014b00 /config
parent9734b5993c479f663f436a92f7690ca871f71116 (diff)
downloadhdf5-0e7dffc0dd751ab69fea3d8e1f9c7a69d417eeae.zip
hdf5-0e7dffc0dd751ab69fea3d8e1f9c7a69d417eeae.tar.gz
hdf5-0e7dffc0dd751ab69fea3d8e1f9c7a69d417eeae.tar.bz2
Only promote maybe-uninitialized warnings to errors on GCC 8. Even on
GCC 8, there may be false positives at low optimization levels? I need to check.
Diffstat (limited to 'config')
-rw-r--r--config/gnu-flags8
1 files changed, 7 insertions, 1 deletions
diff --git a/config/gnu-flags b/config/gnu-flags
index b8a1e1c..8478cd0 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -199,7 +199,7 @@ if test "X-gcc" = "X-$cc_vendor"; then
# H5_ECFLAGS="$H5_ECFLAGS -Werror=discarded-qualifiers"
H5_ECFLAGS="$H5_ECFLAGS -Werror=implicit-function-declaration"
H5_ECFLAGS="$H5_ECFLAGS -Werror=incompatible-pointer-types"
- H5_ECFLAGS="$H5_ECFLAGS -Werror=maybe-uninitialized"
+ H5_ECFLAGS="$H5_ECFLAGS -Wmaybe-uninitialized"
H5_ECFLAGS="$H5_ECFLAGS -Werror=pointer-sign"
H5_ECFLAGS="$H5_ECFLAGS -Werror=pointer-to-int-cast"
H5_ECFLAGS="$H5_ECFLAGS -Werror=switch"
@@ -349,6 +349,12 @@ if test "X-gcc" = "X-$cc_vendor"; then
# gcc 8
if test $cc_vers_major -ge 8; then
+ # For GCC 8, promote maybe-initialized warnings to an error. GCC 8
+ # reports 0 maybe-uninitialized warnings where earlier versions
+ # make many false reports. GCC 8 seems to analyze calls to static
+ # in order to detect initializations that occur there. It's possible
+ # that GCC 8 only performs that analysis at -O3, though.
+ H5_ECFLAGS="$H5_ECFLAGS -Werror=maybe-uninitialized"
H5_ECFLAGS="$H5_ECFLAGS -Werror=cast-function-type"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=4 -Wsuggest-attribute=cold -Wsuggest-attribute=malloc"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc"