summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-05-16 10:24:19 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-05-16 10:27:41 -0700
commit2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f (patch)
tree869b2d36a6a07dca857254202d620358c004489f /m4
parent138c8256f41f242341c7d146c99f4e6fa267a638 (diff)
downloademacs-2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f.tar.gz
Merge with gnulib, pacifying GCC 7
This incorporates: 2017-05-16 manywarnings: update for GCC 7 2017-05-15 sys_select: Avoid "was expanded before it was required" * configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and -Wformat-overflow=2 options, due to too many false alarms. * doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4: Copy from gnulib. * m4/gnulib-comp.m4: Regenerate. * src/coding.c (decode_coding_iso_2022): Fix bug uncovered by -Wimplicit-fallthrough. * src/conf_post.h (FALLTHROUGH): New macro. Use it to mark all switch cases that fall through. * src/editfns.c (styled_format): Use !, not ~, on bool. * src/gtkutil.c (xg_check_special_colors): When using sprintf, don’t trust Gtk to output colors in [0, 1] range. (xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool; this bug was actually caught by Clang. * src/search.c (boyer_moore): Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character. * src/xterm.c (x_draw_glyphless_glyph_string_foreground): Tell GCC that glyph->u.glyphless.ch must be a character.
Diffstat (limited to 'm4')
-rw-r--r--m4/gnulib-comp.m42
-rw-r--r--m4/manywarnings.m425
2 files changed, 23 insertions, 4 deletions
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 8295e483582..3f196d4f1de 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -375,7 +375,7 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([symlink])
fi
gl_UNISTD_MODULE_INDICATOR([symlink])
- gl_HEADER_SYS_SELECT
+ AC_REQUIRE([gl_HEADER_SYS_SELECT])
AC_PROG_MKDIR_P
gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 0f06adecfbb..2d35eff6a2c 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -99,12 +99,11 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
# comm -3 \
# <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
# <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort |
- # grep -v -x -f <(
+ # grep -v -x -F -f <(
# awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
gl_manywarn_set=
- for gl_manywarn_item in \
- -fno-common \
+ for gl_manywarn_item in -fno-common \
-W \
-Wabi \
-Waddress \
@@ -113,6 +112,8 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wattributes \
-Wbad-function-cast \
-Wbool-compare \
+ -Wbool-operation \
+ -Wbuiltin-declaration-mismatch \
-Wbuiltin-macro-redefined \
-Wcast-align \
-Wchar-subscripts \
@@ -122,6 +123,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wcomments \
-Wcoverage-mismatch \
-Wcpp \
+ -Wdangling-else \
-Wdate-time \
-Wdeprecated \
-Wdeprecated-declarations \
@@ -131,10 +133,13 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wdiscarded-qualifiers \
-Wdiv-by-zero \
-Wdouble-promotion \
+ -Wduplicated-branches \
-Wduplicated-cond \
+ -Wduplicate-decl-specifier \
-Wempty-body \
-Wendif-labels \
-Wenum-compare \
+ -Wexpansion-to-defined \
-Wextra \
-Wformat-contains-nul \
-Wformat-extra-args \
@@ -155,6 +160,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Winit-self \
-Winline \
-Wint-conversion \
+ -Wint-in-bool-context \
-Wint-to-pointer-cast \
-Winvalid-memory-model \
-Winvalid-pch \
@@ -163,6 +169,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wlogical-op \
-Wmain \
-Wmaybe-uninitialized \
+ -Wmemset-elt-size \
-Wmemset-transposed-args \
-Wmisleading-indentation \
-Wmissing-braces \
@@ -188,9 +195,12 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wpacked-bitfield-compat \
-Wparentheses \
-Wpointer-arith \
+ -Wpointer-compare \
-Wpointer-sign \
-Wpointer-to-int-cast \
-Wpragmas \
+ -Wpsabi \
+ -Wrestrict \
-Wreturn-local-addr \
-Wreturn-type \
-Wscalar-storage-order \
@@ -214,6 +224,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wswitch \
-Wswitch-bool \
-Wswitch-default \
+ -Wswitch-unreachable \
-Wsync-nand \
-Wsystem-headers \
-Wtautological-compare \
@@ -247,10 +258,18 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
# 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.
+ # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal:
+ ptrdiff_max_max=9223372036854775807
+ gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max"
gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
+ gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2"
+ gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2"
+ gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5"
gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
+ gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2"
gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
+ gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031"
# These are needed for older GCC versions.
if test -n "$GCC"; then