summaryrefslogtreecommitdiff
path: root/gl/m4/manywarnings.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/manywarnings.m4')
-rw-r--r--gl/m4/manywarnings.m463
1 files changed, 57 insertions, 6 deletions
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index e1cee6c..90823b0 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,5 +1,5 @@
-# manywarnings.m4 serial 6
-dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
+# manywarnings.m4 serial 8
+dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -93,6 +93,14 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
fi
# List all gcc warning categories.
+ # To compare this list to your installed GCC's, run this Bash command:
+ #
+ # comm -3 \
+ # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
+ # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort |
+ # grep -v -x -f <(
+ # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
+
gl_manywarn_set=
for gl_manywarn_item in \
-W \
@@ -100,22 +108,28 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Waddress \
-Waggressive-loop-optimizations \
-Wall \
- -Warray-bounds \
-Wattributes \
-Wbad-function-cast \
+ -Wbool-compare \
-Wbuiltin-macro-redefined \
-Wcast-align \
-Wchar-subscripts \
+ -Wchkp \
-Wclobbered \
-Wcomment \
-Wcomments \
-Wcoverage-mismatch \
-Wcpp \
+ -Wdate-time \
-Wdeprecated \
-Wdeprecated-declarations \
+ -Wdesignated-init \
-Wdisabled-optimization \
+ -Wdiscarded-array-qualifiers \
+ -Wdiscarded-qualifiers \
-Wdiv-by-zero \
-Wdouble-promotion \
+ -Wduplicated-cond \
-Wempty-body \
-Wendif-labels \
-Wenum-compare \
@@ -124,22 +138,31 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wformat-extra-args \
-Wformat-nonliteral \
-Wformat-security \
+ -Wformat-signedness \
-Wformat-y2k \
-Wformat-zero-length \
+ -Wframe-address \
-Wfree-nonheap-object \
+ -Whsa \
+ -Wignored-attributes \
-Wignored-qualifiers \
-Wimplicit \
-Wimplicit-function-declaration \
-Wimplicit-int \
+ -Wincompatible-pointer-types \
-Winit-self \
-Winline \
+ -Wint-conversion \
-Wint-to-pointer-cast \
-Winvalid-memory-model \
-Winvalid-pch \
-Wjump-misses-init \
+ -Wlogical-not-parentheses \
-Wlogical-op \
-Wmain \
-Wmaybe-uninitialized \
+ -Wmemset-transposed-args \
+ -Wmisleading-indentation \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-field-initializers \
@@ -150,9 +173,12 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wnarrowing \
-Wnested-externs \
-Wnonnull \
- -Wnormalized=nfc \
+ -Wnonnull-compare \
+ -Wnull-dereference \
+ -Wodr \
-Wold-style-declaration \
-Wold-style-definition \
+ -Wopenmp-simd \
-Woverflow \
-Woverlength-strings \
-Woverride-init \
@@ -165,8 +191,13 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wpragmas \
-Wreturn-local-addr \
-Wreturn-type \
+ -Wscalar-storage-order \
-Wsequence-point \
-Wshadow \
+ -Wshift-count-negative \
+ -Wshift-count-overflow \
+ -Wshift-negative-value \
+ -Wsizeof-array-argument \
-Wsizeof-pointer-memaccess \
-Wstack-protector \
-Wstrict-aliasing \
@@ -176,10 +207,14 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wsuggest-attribute=format \
-Wsuggest-attribute=noreturn \
-Wsuggest-attribute=pure \
+ -Wsuggest-final-methods \
+ -Wsuggest-final-types \
-Wswitch \
+ -Wswitch-bool \
-Wswitch-default \
-Wsync-nand \
-Wsystem-headers \
+ -Wtautological-compare \
-Wtrampolines \
-Wtrigraphs \
-Wtype-limits \
@@ -203,13 +238,29 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wvla \
-Wvolatile-register-var \
-Wwrite-strings \
- -fdiagnostics-show-option \
- -funit-at-a-time \
\
; do
gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
done
+ # gcc --help=warnings outputs an unusual form for these options; list
+ # them here so that the above 'comm' command doesn't report a false match.
+ gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
+ gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
+ gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
+ gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
+
+ # These are needed for older GCC versions.
+ if test -n "$GCC"; then
+ case `($CC --version) 2>/dev/null` in
+ 'gcc (GCC) '[[0-3]].* | \
+ 'gcc (GCC) '4.[[0-7]].*)
+ gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
+ gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
+ ;;
+ esac
+ fi
+
# Disable specific options as needed.
if test "$gl_cv_cc_nomfi_needed" = yes; then
gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"