Commit 50130655 authored by Paul Eggert's avatar Paul Eggert
Browse files

Speed up GCC 10.1 compilation in default Git builds

* configure.ac (nw): GCC 10.1 introduced warnings enabled by -fanalyzer
that slow down compilation considerably.  Generate these warnings only
if --enable-gcc-warnings is explicitly given.  Also, do not bother to
eliminate warnings that Gnulib’s revised manywarnings module no longer
generates.
parent 0fc8671d
......@@ -1030,14 +1030,17 @@ AS_IF([test $gl_gcc_warnings = no],
;;
esac
AS_IF([test $gl_gcc_warnings = yes],
[WERROR_CFLAGS=-Werror])
[WERROR_CFLAGS=-Werror],
[# Use -fanalyzer and related options only if --enable-gcc-warnings,
# as they slow GCC considerably.
nw="$nw -fanalyzer -Wno-analyzer-double-free -Wno-analyzer-malloc-leak"
nw="$nw -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free"])
nw="$nw -Wcast-align -Wcast-align=strict" # Emacs is tricky with pointers.
nw="$nw -Wcast-align=strict" # Emacs is tricky with pointers.
nw="$nw -Wduplicated-branches" # Too many false alarms
nw="$nw -Wformat-overflow=2" # False alarms due to GCC bug 80776
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Woverlength-strings" # Not a problem these days
nw="$nw -Wformat-nonliteral" # we do this a lot
nw="$nw -Wvla" # Emacs uses <vla.h>.
nw="$nw -Wunused-const-variable=2" # lisp.h declares const objects.
nw="$nw -Winline" # OK to ignore 'inline'
......@@ -1046,7 +1049,6 @@ AS_IF([test $gl_gcc_warnings = no],
nw="$nw -Wsync-nand" # irrelevant here, and provokes ObjC warning
nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations
nw="$nw -Wbad-function-cast" # These casts are no worse than others.
nw="$nw -Wabi" # Not useful, perceived as noise
# Emacs doesn't care about shadowing; see
# <https://lists.gnu.org/r/emacs-diffs/2011-11/msg00265.html>.
......@@ -1066,26 +1068,12 @@ AS_IF([test $gl_gcc_warnings = no],
# option problematic.
nw="$nw -Wsuggest-attribute=pure"
# This part is merely for shortening the command line,
# since -Wall implies -Wswitch.
nw="$nw -Wswitch"
# This part is merely for shortening the command line,
# since -Wno-FOO needs to be added below regardless.
nw="$nw -Wmissing-field-initializers"
nw="$nw -Woverride-init"
nw="$nw -Wtype-limits"
nw="$nw -Wunused-parameter"
if test "$emacs_cv_clang" = yes; then
nw="$nw -Wcast-align"
nw="$nw -Wdouble-promotion"
nw="$nw -Wmissing-braces"
fi
# These cause too much noise in the MinGW build
# This causes too much noise in the MinGW build.
if test $opsys = mingw32; then
nw="$nw -Wpointer-sign"
nw="$nw -Wsuggest-attribute=format"
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment