summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/cmake/HDFCompilerFlags.cmake6
-rw-r--r--config/commence.am2
-rw-r--r--config/gnu-flags144
-rw-r--r--config/gnu-warnings/4.2-4.33
-rw-r--r--config/gnu-warnings/4.2-4.42
-rw-r--r--config/gnu-warnings/4.2-4.62
-rw-r--r--config/gnu-warnings/4.2-4.last3
-rw-r--r--config/gnu-warnings/4.32
-rw-r--r--config/gnu-warnings/4.43
-rw-r--r--config/gnu-warnings/4.51
-rw-r--r--config/gnu-warnings/4.5-4.63
-rw-r--r--config/gnu-warnings/4.62
-rw-r--r--config/gnu-warnings/4.75
-rw-r--r--config/gnu-warnings/4.81
-rw-r--r--config/gnu-warnings/4.91
-rw-r--r--config/gnu-warnings/52
-rw-r--r--config/gnu-warnings/69
-rw-r--r--config/gnu-warnings/77
-rw-r--r--config/gnu-warnings/83
-rw-r--r--config/gnu-warnings/92
-rw-r--r--config/gnu-warnings/developer-4.57
-rw-r--r--config/gnu-warnings/developer-4.61
-rw-r--r--config/gnu-warnings/developer-4.77
-rw-r--r--config/gnu-warnings/developer-4.81
-rw-r--r--config/gnu-warnings/developer-71
-rw-r--r--config/gnu-warnings/developer-83
-rw-r--r--config/gnu-warnings/developer-general (renamed from config/gnu-warnings-developer-general)5
-rw-r--r--config/gnu-warnings/error-512
-rw-r--r--config/gnu-warnings/error-89
-rw-r--r--config/gnu-warnings/error-general24
-rw-r--r--config/gnu-warnings/general (renamed from config/gnu-warnings-general)2
-rw-r--r--config/gnu-warnings/no-developer-4.51
-rw-r--r--config/gnu-warnings/no-developer-4.61
-rw-r--r--config/gnu-warnings/no-developer-4.72
-rw-r--r--config/gnu-warnings/no-developer-4.81
-rw-r--r--config/gnu-warnings/no-developer-82
-rw-r--r--config/gnu-warnings/no-developer-general (renamed from config/gnu-warnings-no-developer-general)0
-rw-r--r--configure.ac4
-rw-r--r--src/libhdf5.settings.in2
39 files changed, 208 insertions, 80 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 17b0854..c395193 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -128,7 +128,7 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
set (H5_CFLAGS0 "${H5_CFLAGS0} -Wsign-compare -Wtrigraphs -Wwrite-strings")
endif()
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-general")
+ ADD_H5_FLAGS (CMAKE_C_FLAGS_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
message (STATUS "CMAKE_C_FLAGS_GENERAL=${CMAKE_C_FLAGS_GENERAL}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_GENERAL}")
set (H5_CFLAGS0 "${H5_CFLAGS0} -Wbad-function-cast -Wcast-align")
@@ -154,12 +154,12 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
set (H5_CFLAGS0 "${H5_CFLAGS0} -Winline -Wreorder -Wport -Wstrict-aliasing")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- ADD_H5_FLAGS (CMAKE_C_FLAGS_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-developer-general")
+ ADD_H5_FLAGS (CMAKE_C_FLAGS_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_DEV_GENERAL}")
endif ()
else ()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- ADD_H5_FLAGS (CMAKE_C_FLAGS_NO_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings-no-developer-general")
+ ADD_H5_FLAGS (CMAKE_C_FLAGS_NO_DEV_GENERAL "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
set (H5_CFLAGS0 "${H5_CFLAGS0} ${CMAKE_C_FLAGS_NO_DEV_GENERAL}")
endif ()
endif ()
diff --git a/config/commence.am b/config/commence.am
index a16eee5..830c494 100644
--- a/config/commence.am
+++ b/config/commence.am
@@ -70,7 +70,7 @@ H5CPP=${DESTDIR}$(bindir)/h5c++
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_FCFLAGS=@AM_FCFLAGS@ @H5_FCFLAGS@
AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@
AM_CPPFLAGS=@AM_CPPFLAGS@ @H5_CPPFLAGS@
diff --git a/config/gnu-flags b/config/gnu-flags
index 11aaa71..ca0e1b4 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -18,6 +18,24 @@
#
#
+# For now, do not promote any warnings to errors.
+#
+PROMOTE_ERRORS_DFLT=no
+
+#
+# This filter rewrites -Werror= as -W, in that way demoting warnings
+# promoted to errors back to warnings, if PROMOTE_ERRORS is no.
+#
+demote_errors()
+{
+ if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then
+ sed 's,-Werror=,-W,g'
+ else
+ cat
+ fi
+}
+
+#
# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as
# subroutine argument(s), remove comments starting with # and ending
# at EOL, replace spans of whitespace (including newlines) with spaces,
@@ -26,7 +44,7 @@
load_gcc_arguments()
{
set -- $(for arg; do
- sed 's,#.*$,,' $srcdir/config/gnu-${arg}
+ sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors
done)
IFS=' ' echo "$*"
}
@@ -171,142 +189,120 @@ if test "X-gcc" = "X-$cc_vendor"; then
# General #
###########
- # Note that some of the flags listed here really should be developer
- # flags (listed in a separate variable, below) but we put them here
- # because they are not raised by the current code and we'd like to
- # know if they do start showing up.
- #
- # 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.
- #
- # NOTE: Due to the divergence in the C and C++, we're dropping support for
- # compiling the C library with a C++ compiler and dropping the -Wc++-compat
- # warning.
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments warnings-general)"
- H5_CFLAGS="$H5_CFLAGS -Wbad-function-cast -Wcast-align"
- H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wdisabled-optimization"
- H5_CFLAGS="$H5_CFLAGS -Wmissing-declarations"
- H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked"
- H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wswitch-default"
- H5_CFLAGS="$H5_CFLAGS -Wunused-macros -Wunsafe-loop-optimizations"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments general)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-general)"
######################
# Developer warnings #
######################
- # (suggestions from gcc, not code problems)
- # NOTE: -Wformat-nonliteral added back in here (from being disabled in H5_CFLAGS)
- NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-no-developer-general)
- DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments warnings-developer-general)
+ NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments no-developer-general)
+ DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments developer-general)
#######################
# gcc 4 special cases #
#######################
- # Disable warnings about using the 'long long' type w/ gcc 4.6 and earlier
+ # GCC 4.2 through 4.6
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.6)"
fi
- # -Wvolatile-register-var was later incorporated into -Wall and
- # only needs to be specified explicitly for gcc 4.2-4.3
+ # GCC 4.2 through 4.3
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then
- H5_CFLAGS="$H5_CFLAGS -Wvolatile-register-var"
- fi
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.3)"
+ fi
- # -Wstrict-aliasing was later incorporated into -Wall and
- # only needs to be specified explicitly for gcc 4.5-4.6
+ # GCC 4.5 through 4.6
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.5-4.6)"
fi
- # The non-valued form of -Wstrict-overflow is used in gcc 4.2-4.4
+ # GCC 4.2 through 4.4
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.4)"
fi
- # -Wvla was later incorporated into -Wpedantic and
- # only needs to be specified explicitly for gcc 4
+ # GCC 4.2 through the end of GCC 4 series
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then
- H5_CFLAGS="$H5_CFLAGS -Wvla"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.last)"
fi
#############################
# Version-specific warnings #
#############################
- # gcc 4.3
+ # gcc >= 4.3
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then
- H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560"
- fi
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.3)"
+ fi
- # gcc 4.4
+ # gcc >= 4.4
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then
- H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.4)"
fi
- # gcc 4.5
+ # gcc >= 4.5
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
- H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wunsuffixed-float-constants"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-unsuffixed-float-constants"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.5)"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)"
fi
- # gcc 4.6
+ # gcc >= 4.6
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then
- H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.6)"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)"
fi
- # gcc 4.7
+ # gcc >= 4.7
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then
- H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance"
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.7)"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)"
fi
- # gcc 4.8
+ # gcc >= 4.8
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format"
- NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.8)"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)"
fi
- # gcc 4.9
+ # gcc >= 4.9
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then
- H5_CFLAGS="$H5_CFLAGS -Wdate-time"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.9)"
fi
- # gcc 5
+ # gcc >= 5
if test $cc_vers_major -ge 5; then
- H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 5)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-5)"
fi
- # gcc 6
+ # gcc >= 6
if test $cc_vers_major -ge 6; then
- H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 6)"
fi
- # gcc 7
+ # gcc >= 7
if test $cc_vers_major -ge 7; then
- DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=2"
- H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 -Wimplicit-fallthrough=5 -Wrestrict"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 7)"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)"
fi
# gcc 8
if test $cc_vers_major -ge 8; then
- 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"
- H5_CFLAGS="$H5_CFLAGS -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 8)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-8)"
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)"
+ NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)"
fi
# gcc 9
if test $cc_vers_major -ge 9; then
- H5_CFLAGS="$H5_CFLAGS -Wattribute-alias=2 -Wmissing-profile"
+ H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 9)"
fi
#################
diff --git a/config/gnu-warnings/4.2-4.3 b/config/gnu-warnings/4.2-4.3
new file mode 100644
index 0000000..1881797
--- /dev/null
+++ b/config/gnu-warnings/4.2-4.3
@@ -0,0 +1,3 @@
+# -Wvolatile-register-var was later incorporated into -Wall and
+# only needs to be specified explicitly for gcc 4.2-4.3
+-Wvolatile-register-var
diff --git a/config/gnu-warnings/4.2-4.4 b/config/gnu-warnings/4.2-4.4
new file mode 100644
index 0000000..ec4876f
--- /dev/null
+++ b/config/gnu-warnings/4.2-4.4
@@ -0,0 +1,2 @@
+# The non-valued form of -Wstrict-overflow is used in gcc 4.2-4.4
+-Wstrict-overflow
diff --git a/config/gnu-warnings/4.2-4.6 b/config/gnu-warnings/4.2-4.6
new file mode 100644
index 0000000..37df4ab
--- /dev/null
+++ b/config/gnu-warnings/4.2-4.6
@@ -0,0 +1,2 @@
+# Disable warnings about using the 'long long' type w/ gcc 4.6 and earlier
+-Wno-long-long
diff --git a/config/gnu-warnings/4.2-4.last b/config/gnu-warnings/4.2-4.last
new file mode 100644
index 0000000..2db90fb
--- /dev/null
+++ b/config/gnu-warnings/4.2-4.last
@@ -0,0 +1,3 @@
+# -Wvla was later incorporated into -Wpedantic and
+# only needs to be specified explicitly for gcc 4
+-Wvla
diff --git a/config/gnu-warnings/4.3 b/config/gnu-warnings/4.3
new file mode 100644
index 0000000..13d8558
--- /dev/null
+++ b/config/gnu-warnings/4.3
@@ -0,0 +1,2 @@
+-Wlarger-than=2560
+-Wlogical-op
diff --git a/config/gnu-warnings/4.4 b/config/gnu-warnings/4.4
new file mode 100644
index 0000000..42929b5
--- /dev/null
+++ b/config/gnu-warnings/4.4
@@ -0,0 +1,3 @@
+-Wframe-larger-than=16384
+-Wpacked-bitfield-compat
+-Wsync-nand
diff --git a/config/gnu-warnings/4.5 b/config/gnu-warnings/4.5
new file mode 100644
index 0000000..ddb96df
--- /dev/null
+++ b/config/gnu-warnings/4.5
@@ -0,0 +1 @@
+-Wstrict-overflow=5
diff --git a/config/gnu-warnings/4.5-4.6 b/config/gnu-warnings/4.5-4.6
new file mode 100644
index 0000000..d3035fe
--- /dev/null
+++ b/config/gnu-warnings/4.5-4.6
@@ -0,0 +1,3 @@
+# -Wstrict-aliasing was later incorporated into -Wall and
+# only needs to be specified explicitly for gcc 4.5-4.6
+-Wstrict-aliasing
diff --git a/config/gnu-warnings/4.6 b/config/gnu-warnings/4.6
new file mode 100644
index 0000000..140a20c
--- /dev/null
+++ b/config/gnu-warnings/4.6
@@ -0,0 +1,2 @@
+-Wdouble-promotion
+-Wtrampolines
diff --git a/config/gnu-warnings/4.7 b/config/gnu-warnings/4.7
new file mode 100644
index 0000000..c47fe4b
--- /dev/null
+++ b/config/gnu-warnings/4.7
@@ -0,0 +1,5 @@
+#
+# -Wstack-usage=8192 warnings need to be swept up on a branch so
+# that we can stop burdening the whole development team.
+#
+-Wstack-usage=8192
diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8
new file mode 100644
index 0000000..5dc577f
--- /dev/null
+++ b/config/gnu-warnings/4.8
@@ -0,0 +1 @@
+-Wmaybe-uninitialized
diff --git a/config/gnu-warnings/4.9 b/config/gnu-warnings/4.9
new file mode 100644
index 0000000..78aa929
--- /dev/null
+++ b/config/gnu-warnings/4.9
@@ -0,0 +1 @@
+-Wdate-time
diff --git a/config/gnu-warnings/5 b/config/gnu-warnings/5
new file mode 100644
index 0000000..32cb196
--- /dev/null
+++ b/config/gnu-warnings/5
@@ -0,0 +1,2 @@
+-Warray-bounds=2
+-Wc99-c11-compat
diff --git a/config/gnu-warnings/6 b/config/gnu-warnings/6
new file mode 100644
index 0000000..736a446
--- /dev/null
+++ b/config/gnu-warnings/6
@@ -0,0 +1,9 @@
+#
+# Careful! -Wduplicated-cond, combined with HDF5's heavy use of
+# macros, can make a lot of noise.
+#
+-Wduplicated-cond
+-Whsa
+-Wnormalized
+-Wnull-dereference
+-Wunused-const-variable
diff --git a/config/gnu-warnings/7 b/config/gnu-warnings/7
new file mode 100644
index 0000000..266f5c1
--- /dev/null
+++ b/config/gnu-warnings/7
@@ -0,0 +1,7 @@
+-Walloca
+-Walloc-zero
+-Wduplicated-branches
+-Wformat-overflow=2
+-Wformat-truncation=1
+-Wimplicit-fallthrough=5
+-Wrestrict
diff --git a/config/gnu-warnings/8 b/config/gnu-warnings/8
new file mode 100644
index 0000000..5e7519d
--- /dev/null
+++ b/config/gnu-warnings/8
@@ -0,0 +1,3 @@
+-Wattribute-alias
+-Wcast-align=strict
+-Wshift-overflow=2
diff --git a/config/gnu-warnings/9 b/config/gnu-warnings/9
new file mode 100644
index 0000000..c084350
--- /dev/null
+++ b/config/gnu-warnings/9
@@ -0,0 +1,2 @@
+-Wattribute-alias=2
+-Wmissing-profile
diff --git a/config/gnu-warnings/developer-4.5 b/config/gnu-warnings/developer-4.5
new file mode 100644
index 0000000..48df846
--- /dev/null
+++ b/config/gnu-warnings/developer-4.5
@@ -0,0 +1,7 @@
+#
+# -Wjump-misses-init makes lots of noise for a questionable benefit.
+# Can jumping over an initialization in C cause any harm, if
+# the variable is never *used* before it has been initialized?
+#
+-Wjump-misses-init
+-Wunsuffixed-float-constants
diff --git a/config/gnu-warnings/developer-4.6 b/config/gnu-warnings/developer-4.6
new file mode 100644
index 0000000..2372fbf
--- /dev/null
+++ b/config/gnu-warnings/developer-4.6
@@ -0,0 +1 @@
+-Wsuggest-attribute=const
diff --git a/config/gnu-warnings/developer-4.7 b/config/gnu-warnings/developer-4.7
new file mode 100644
index 0000000..a3b0781
--- /dev/null
+++ b/config/gnu-warnings/developer-4.7
@@ -0,0 +1,7 @@
+-Wsuggest-attribute=noreturn
+-Wsuggest-attribute=pure
+#
+# It's not clear that -Wvector-operation-performance warnings are
+# actionable, so they are demoted to "developer" warnings.
+#
+-Wvector-operation-performance
diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8
new file mode 100644
index 0000000..b0109e2
--- /dev/null
+++ b/config/gnu-warnings/developer-4.8
@@ -0,0 +1 @@
+-Wsuggest-attribute=format
diff --git a/config/gnu-warnings/developer-7 b/config/gnu-warnings/developer-7
new file mode 100644
index 0000000..2a3ce7e
--- /dev/null
+++ b/config/gnu-warnings/developer-7
@@ -0,0 +1 @@
+-Wstringop-overflow=2
diff --git a/config/gnu-warnings/developer-8 b/config/gnu-warnings/developer-8
new file mode 100644
index 0000000..a2ba7ca
--- /dev/null
+++ b/config/gnu-warnings/developer-8
@@ -0,0 +1,3 @@
+-Wstringop-overflow=4
+-Wsuggest-attribute=cold
+-Wsuggest-attribute=malloc
diff --git a/config/gnu-warnings-developer-general b/config/gnu-warnings/developer-general
index 698f0e0..b34c4b7 100644
--- a/config/gnu-warnings-developer-general
+++ b/config/gnu-warnings/developer-general
@@ -2,7 +2,12 @@
# NOTE: -Wformat-nonliteral added back in here (from being disabled in
# H5_CFLAGS)
-Waggregate-return
+-Wdisabled-optimization
-Wformat-nonliteral
-Winline
-Wmissing-format-attribute
-Wmissing-noreturn
+-Wswitch-default
+-Wswitch-enum
+-Wunsafe-loop-optimizations
+-Wunused-macros
diff --git a/config/gnu-warnings/error-5 b/config/gnu-warnings/error-5
new file mode 100644
index 0000000..f7e1138
--- /dev/null
+++ b/config/gnu-warnings/error-5
@@ -0,0 +1,12 @@
+-Werror=incompatible-pointer-types
+#
+# In GCC 4.4.7, the compiler gripes about shadowed global
+# declarations when a local variable uses the name of a
+# function that's in a system header file. For some reason,
+# later versions of GCC (e.g., 5.2.0) don't complain about
+# the shadowed globals. Maybe later versions are less fussy?
+# Anyway, the shadowing seems to be harmless, and GCC 4.4.7
+# is not a supported compiler, so let us promote shadowed globals
+# warnings to errors only for GCC 5 and later.
+#
+-Werror=shadow
diff --git a/config/gnu-warnings/error-8 b/config/gnu-warnings/error-8
new file mode 100644
index 0000000..36c1414
--- /dev/null
+++ b/config/gnu-warnings/error-8
@@ -0,0 +1,9 @@
+-Werror=cast-function-type
+#
+# 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.
+#
+-Werror=maybe-uninitialized
diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general
new file mode 100644
index 0000000..d0e272a
--- /dev/null
+++ b/config/gnu-warnings/error-general
@@ -0,0 +1,24 @@
+#
+# HDF5 code should not trigger the following warnings under any
+# circumstances, so ask the compiler to treat them as errors:
+#
+-Werror=bad-function-cast
+-Werror=cast-align
+-Werror=declaration-after-statement
+-Werror=format
+-Werror=implicit-function-declaration
+-Werror=missing-declarations
+-Werror=missing-prototypes
+-Werror=nested-externs
+-Werror=old-style-definition
+-Werror=packed
+-Werror=pointer-sign
+-Werror=pointer-to-int-cast
+-Werror=redundant-decls
+-Werror=strict-prototypes
+-Werror=switch
+-Werror=unused-but-set-variable
+-Werror=unused-function
+-Werror=unused-parameter
+-Werror=unused-variable
+#-Werror=discarded-qualifiers
diff --git a/config/gnu-warnings-general b/config/gnu-warnings/general
index 9e67b71..a7a20b7 100644
--- a/config/gnu-warnings-general
+++ b/config/gnu-warnings/general
@@ -29,4 +29,4 @@
-Wshadow
-Wundef
-Wwrite-strings
--pedantic \ No newline at end of file
+-pedantic
diff --git a/config/gnu-warnings/no-developer-4.5 b/config/gnu-warnings/no-developer-4.5
new file mode 100644
index 0000000..ef7d38f
--- /dev/null
+++ b/config/gnu-warnings/no-developer-4.5
@@ -0,0 +1 @@
+-Wno-unsuffixed-float-constants
diff --git a/config/gnu-warnings/no-developer-4.6 b/config/gnu-warnings/no-developer-4.6
new file mode 100644
index 0000000..ea9cc66
--- /dev/null
+++ b/config/gnu-warnings/no-developer-4.6
@@ -0,0 +1 @@
+-Wno-suggest-attribute=const
diff --git a/config/gnu-warnings/no-developer-4.7 b/config/gnu-warnings/no-developer-4.7
new file mode 100644
index 0000000..5b85e1f
--- /dev/null
+++ b/config/gnu-warnings/no-developer-4.7
@@ -0,0 +1,2 @@
+-Wno-suggest-attribute=noreturn
+-Wno-suggest-attribute=pure
diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8
new file mode 100644
index 0000000..e42e09f
--- /dev/null
+++ b/config/gnu-warnings/no-developer-4.8
@@ -0,0 +1 @@
+-Wno-suggest-attribute=format
diff --git a/config/gnu-warnings/no-developer-8 b/config/gnu-warnings/no-developer-8
new file mode 100644
index 0000000..2134bad
--- /dev/null
+++ b/config/gnu-warnings/no-developer-8
@@ -0,0 +1,2 @@
+-Wno-suggest-attribute=cold
+-Wno-suggest-attribute=malloc
diff --git a/config/gnu-warnings-no-developer-general b/config/gnu-warnings/no-developer-general
index 85dc0a3..85dc0a3 100644
--- a/config/gnu-warnings-no-developer-general
+++ b/config/gnu-warnings/no-developer-general
diff --git a/configure.ac b/configure.ac
index 0eada60..5851b32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,7 +103,11 @@ AC_SUBST([AR_FLAGS])
## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but
## not exported to h5cc (or h5fc, etc.)
+##
+## H5_ECFLAGS is for warnings that should be treated as errors.
+##
AC_SUBST([H5_CFLAGS])
+AC_SUBST([H5_ECFLAGS])
AC_SUBST([H5_CPPFLAGS])
AC_SUBST([H5_FCFLAGS])
AC_SUBST([H5_CXXFLAGS])
diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in
index 1591bed..0c2be75 100644
--- a/src/libhdf5.settings.in
+++ b/src/libhdf5.settings.in
@@ -39,7 +39,7 @@ Languages:
H5_CPPFLAGS: @H5_CPPFLAGS@
AM_CPPFLAGS: @AM_CPPFLAGS@
C Flags: @CFLAGS@
- H5 C Flags: @H5_CFLAGS@
+ H5 C Flags: @H5_CFLAGS@ @H5_ECFLAGS@
AM C Flags: @AM_CFLAGS@
Shared C Library: @enable_shared@
Static C Library: @enable_static@