From d8e5995f6d158ddf835da1ee669240ca092bf4a7 Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 25 Feb 2020 11:38:15 -0600 Subject: Break out warnings into more files that autoconf and CMake can share. This change temporarily disables the warnings that were promoted to errors, but I will add those warnings back as warnings, not errors, in the next commit. --- config/gnu-flags | 118 ++++++++++++++-------------------- config/gnu-warnings-4.2-4.3 | 3 + config/gnu-warnings-4.2-4.4 | 2 + config/gnu-warnings-4.2-4.6 | 2 + config/gnu-warnings-4.2-4.last | 3 + config/gnu-warnings-4.3 | 2 + config/gnu-warnings-4.4 | 3 + config/gnu-warnings-4.5 | 1 + config/gnu-warnings-4.5-4.6 | 3 + config/gnu-warnings-4.6 | 2 + config/gnu-warnings-4.7 | 5 ++ config/gnu-warnings-4.8 | 1 + config/gnu-warnings-4.9 | 1 + config/gnu-warnings-5 | 2 + config/gnu-warnings-6 | 9 +++ config/gnu-warnings-7 | 7 ++ config/gnu-warnings-8 | 3 + config/gnu-warnings-9 | 2 + config/gnu-warnings-developer-4.5 | 7 ++ config/gnu-warnings-developer-4.6 | 1 + config/gnu-warnings-developer-4.7 | 7 ++ config/gnu-warnings-developer-4.8 | 1 + config/gnu-warnings-developer-7 | 1 + config/gnu-warnings-developer-8 | 3 + config/gnu-warnings-developer-general | 5 ++ config/gnu-warnings-general | 2 +- config/gnu-warnings-no-developer-4.5 | 1 + config/gnu-warnings-no-developer-4.6 | 1 + config/gnu-warnings-no-developer-4.7 | 2 + config/gnu-warnings-no-developer-4.8 | 1 + config/gnu-warnings-no-developer-8 | 2 + config/gnu-werrors-5 | 12 ++++ config/gnu-werrors-8 | 9 +++ config/gnu-werrors-general | 24 +++++++ 34 files changed, 177 insertions(+), 71 deletions(-) create mode 100644 config/gnu-warnings-4.2-4.3 create mode 100644 config/gnu-warnings-4.2-4.4 create mode 100644 config/gnu-warnings-4.2-4.6 create mode 100644 config/gnu-warnings-4.2-4.last create mode 100644 config/gnu-warnings-4.3 create mode 100644 config/gnu-warnings-4.4 create mode 100644 config/gnu-warnings-4.5 create mode 100644 config/gnu-warnings-4.5-4.6 create mode 100644 config/gnu-warnings-4.6 create mode 100644 config/gnu-warnings-4.7 create mode 100644 config/gnu-warnings-4.8 create mode 100644 config/gnu-warnings-4.9 create mode 100644 config/gnu-warnings-5 create mode 100644 config/gnu-warnings-6 create mode 100644 config/gnu-warnings-7 create mode 100644 config/gnu-warnings-8 create mode 100644 config/gnu-warnings-9 create mode 100644 config/gnu-warnings-developer-4.5 create mode 100644 config/gnu-warnings-developer-4.6 create mode 100644 config/gnu-warnings-developer-4.7 create mode 100644 config/gnu-warnings-developer-4.8 create mode 100644 config/gnu-warnings-developer-7 create mode 100644 config/gnu-warnings-developer-8 create mode 100644 config/gnu-warnings-no-developer-4.5 create mode 100644 config/gnu-warnings-no-developer-4.6 create mode 100644 config/gnu-warnings-no-developer-4.7 create mode 100644 config/gnu-warnings-no-developer-4.8 create mode 100644 config/gnu-warnings-no-developer-8 create mode 100644 config/gnu-werrors-5 create mode 100644 config/gnu-werrors-8 create mode 100644 config/gnu-werrors-general diff --git a/config/gnu-flags b/config/gnu-flags index 3ca74c1..41d9058 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -171,35 +171,13 @@ 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_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments werrors-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) @@ -207,106 +185,106 @@ if test "X-gcc" = "X-$cc_vendor"; then # 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 warnings-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 warnings-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 warnings-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 warnings-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 warnings-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 warnings-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 warnings-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 warnings-4.5)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-developer-4.5)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-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 warnings-4.6)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-developer-4.6)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-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 warnings-4.7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-developer-4.7)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-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 warnings-4.8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-developer-4.8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-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 warnings-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 warnings-5)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments werrors-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 warnings-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 warnings-7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-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 warnings-8)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments werrors-8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-developer-8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments warnings-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 warnings-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-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-werrors-5 b/config/gnu-werrors-5 new file mode 100644 index 0000000..f7e1138 --- /dev/null +++ b/config/gnu-werrors-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-werrors-8 b/config/gnu-werrors-8 new file mode 100644 index 0000000..36c1414 --- /dev/null +++ b/config/gnu-werrors-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-werrors-general b/config/gnu-werrors-general new file mode 100644 index 0000000..d0e272a --- /dev/null +++ b/config/gnu-werrors-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 -- cgit v0.12