summaryrefslogtreecommitdiffstats
path: root/config/gnu-warnings
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-04-23 19:32:29 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-04-23 19:32:29 (GMT)
commitf9a3ae50812a527c7b88a39d7d5b6629aa234a2d (patch)
tree0f8086db007f84788c5e0ae717c7ef550891e205 /config/gnu-warnings
parent5ea58acf8a2bdf8ca19d4c86d9ef94fbc4ac449f (diff)
downloadhdf5-f9a3ae50812a527c7b88a39d7d5b6629aa234a2d.zip
hdf5-f9a3ae50812a527c7b88a39d7d5b6629aa234a2d.tar.gz
hdf5-f9a3ae50812a527c7b88a39d7d5b6629aa234a2d.tar.bz2
TRILAB-244 separate CXX warnings and errors from C
Diffstat (limited to 'config/gnu-warnings')
-rw-r--r--config/gnu-warnings/cxx-51
-rw-r--r--config/gnu-warnings/cxx-error-511
-rw-r--r--config/gnu-warnings/cxx-error-general32
-rw-r--r--config/gnu-warnings/cxx-general16
-rw-r--r--config/gnu-warnings/error-820
5 files changed, 76 insertions, 4 deletions
diff --git a/config/gnu-warnings/cxx-5 b/config/gnu-warnings/cxx-5
new file mode 100644
index 0000000..723e448
--- /dev/null
+++ b/config/gnu-warnings/cxx-5
@@ -0,0 +1 @@
+-Warray-bounds=2
diff --git a/config/gnu-warnings/cxx-error-5 b/config/gnu-warnings/cxx-error-5
new file mode 100644
index 0000000..8cc8c9d
--- /dev/null
+++ b/config/gnu-warnings/cxx-error-5
@@ -0,0 +1,11 @@
+#
+# 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/cxx-error-general b/config/gnu-warnings/cxx-error-general
new file mode 100644
index 0000000..85cd9a3
--- /dev/null
+++ b/config/gnu-warnings/cxx-error-general
@@ -0,0 +1,32 @@
+#
+# HDF5 code should not trigger the following warnings under any
+# circumstances, so ask the compiler to treat them as errors:
+#
+# NOTE: c++/test files are not compatible with these warnings as errors
+# c++/test/tcompound.cpp
+# -Werror=cast-align
+-Wcast-align
+# NOTE: c++/src files are not compatible with these warnings as errors
+# c++/src/H5Object.cpp
+# -Werror=missing-declarations
+-Wmissing-declarations
+-Werror=packed
+-Werror=redundant-decls
+-Werror=switch
+# NOTE: c++/test files are not compatible with these warnings as errors
+# c++/test/tattr.cpp
+# -Werror=unused-but-set-variable
+-Wunused-but-set-variable
+-Werror=unused-function
+-Werror=unused-variable
+# NOTE: c++/src files are not compatible with these warnings as errors
+# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp
+# -Werror=unused-parameter
+-Wunused-parameter
+#
+# Other files not compatible
+# NOTE: c++/test files are not compatible with these warnings as errors
+# c++/test/titerate.cpp,c++/test/tarray.cpp
+# -Werror=missing-declarations
+# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp
+# -Werror=unused-parameter
diff --git a/config/gnu-warnings/cxx-general b/config/gnu-warnings/cxx-general
index ee7ee22..9548cc0 100644
--- a/config/gnu-warnings/cxx-general
+++ b/config/gnu-warnings/cxx-general
@@ -6,14 +6,26 @@
# 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.
--Wabi
+-Wall
+-Wcast-qual
+-Wconversion
-Wctor-dtor-privacy
-Weffc++
-##-Wendif-labels
+-Wextra
+-Wfloat-equal
+-Wformat=2
+-Winit-self
+-Winvalid-pch
+-Wmissing-include-dirs
+-Wno-format-nonliteral
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wreorder
+-Wshadow
-Wsign-promo
##-Wunreachable-code
+-Wundef
##-Wvariadic-macros
+-Wwrite-strings
+-pedantic
diff --git a/config/gnu-warnings/error-8 b/config/gnu-warnings/error-8
index 36c1414..2f54a4d 100644
--- a/config/gnu-warnings/error-8
+++ b/config/gnu-warnings/error-8
@@ -1,4 +1,7 @@
--Werror=cast-function-type
+# NOTE: src/ files are not compatible with these warnings as errors
+# src/H5Dchunk.c
+# -Werror=cast-function-type
+-Wcast-function-type
#
# For GCC 8, promote maybe-initialized warnings to an error. GCC 8
# reports 0 maybe-uninitialized warnings where earlier versions
@@ -6,4 +9,17 @@
# in order to detect initializations that occur there. It's possible
# that GCC 8 only performs that analysis at -O3, though.
#
--Werror=maybe-uninitialized
+#
+# NOTE: File Driver files are not compatible with these warnings as errors
+# H5FDlog.c,
+# -Werror=maybe-uninitialized
+-Wmaybe-uninitialized
+# NOTE: src/ files are not compatible with these warnings as errors
+# src/H5Shyper.c,src/H5SL.c,src/H5Shyper.c
+# -Werror=maybe-uninitialized
+# NOTE: Test files are not compatible with these warnings as errors
+# test/cache_common.c,
+# -Werror=maybe-uninitialized
+# NOTE: hl/src/ files are not compatible with these warnings as errors
+# hl/src/H5DS.c,
+# -Werror=maybe-uninitialized