diff options
| author | Paul Eggert | 2017-05-16 10:24:19 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-05-16 10:27:41 -0700 |
| commit | 2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f (patch) | |
| tree | 869b2d36a6a07dca857254202d620358c004489f /m4 | |
| parent | 138c8256f41f242341c7d146c99f4e6fa267a638 (diff) | |
| download | emacs-2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f.tar.gz emacs-2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f.zip | |
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.m4 | 2 | ||||
| -rw-r--r-- | m4/manywarnings.m4 | 25 |
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], | |||
| 375 | AC_LIBOBJ([symlink]) | 375 | AC_LIBOBJ([symlink]) |
| 376 | fi | 376 | fi |
| 377 | gl_UNISTD_MODULE_INDICATOR([symlink]) | 377 | gl_UNISTD_MODULE_INDICATOR([symlink]) |
| 378 | gl_HEADER_SYS_SELECT | 378 | AC_REQUIRE([gl_HEADER_SYS_SELECT]) |
| 379 | AC_PROG_MKDIR_P | 379 | AC_PROG_MKDIR_P |
| 380 | gl_HEADER_SYS_STAT_H | 380 | gl_HEADER_SYS_STAT_H |
| 381 | AC_PROG_MKDIR_P | 381 | 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], | |||
| 99 | # comm -3 \ | 99 | # comm -3 \ |
| 100 | # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ | 100 | # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ |
| 101 | # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | | 101 | # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | |
| 102 | # grep -v -x -f <( | 102 | # grep -v -x -F -f <( |
| 103 | # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec)) | 103 | # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec)) |
| 104 | 104 | ||
| 105 | gl_manywarn_set= | 105 | gl_manywarn_set= |
| 106 | for gl_manywarn_item in \ | 106 | for gl_manywarn_item in -fno-common \ |
| 107 | -fno-common \ | ||
| 108 | -W \ | 107 | -W \ |
| 109 | -Wabi \ | 108 | -Wabi \ |
| 110 | -Waddress \ | 109 | -Waddress \ |
| @@ -113,6 +112,8 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 113 | -Wattributes \ | 112 | -Wattributes \ |
| 114 | -Wbad-function-cast \ | 113 | -Wbad-function-cast \ |
| 115 | -Wbool-compare \ | 114 | -Wbool-compare \ |
| 115 | -Wbool-operation \ | ||
| 116 | -Wbuiltin-declaration-mismatch \ | ||
| 116 | -Wbuiltin-macro-redefined \ | 117 | -Wbuiltin-macro-redefined \ |
| 117 | -Wcast-align \ | 118 | -Wcast-align \ |
| 118 | -Wchar-subscripts \ | 119 | -Wchar-subscripts \ |
| @@ -122,6 +123,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 122 | -Wcomments \ | 123 | -Wcomments \ |
| 123 | -Wcoverage-mismatch \ | 124 | -Wcoverage-mismatch \ |
| 124 | -Wcpp \ | 125 | -Wcpp \ |
| 126 | -Wdangling-else \ | ||
| 125 | -Wdate-time \ | 127 | -Wdate-time \ |
| 126 | -Wdeprecated \ | 128 | -Wdeprecated \ |
| 127 | -Wdeprecated-declarations \ | 129 | -Wdeprecated-declarations \ |
| @@ -131,10 +133,13 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 131 | -Wdiscarded-qualifiers \ | 133 | -Wdiscarded-qualifiers \ |
| 132 | -Wdiv-by-zero \ | 134 | -Wdiv-by-zero \ |
| 133 | -Wdouble-promotion \ | 135 | -Wdouble-promotion \ |
| 136 | -Wduplicated-branches \ | ||
| 134 | -Wduplicated-cond \ | 137 | -Wduplicated-cond \ |
| 138 | -Wduplicate-decl-specifier \ | ||
| 135 | -Wempty-body \ | 139 | -Wempty-body \ |
| 136 | -Wendif-labels \ | 140 | -Wendif-labels \ |
| 137 | -Wenum-compare \ | 141 | -Wenum-compare \ |
| 142 | -Wexpansion-to-defined \ | ||
| 138 | -Wextra \ | 143 | -Wextra \ |
| 139 | -Wformat-contains-nul \ | 144 | -Wformat-contains-nul \ |
| 140 | -Wformat-extra-args \ | 145 | -Wformat-extra-args \ |
| @@ -155,6 +160,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 155 | -Winit-self \ | 160 | -Winit-self \ |
| 156 | -Winline \ | 161 | -Winline \ |
| 157 | -Wint-conversion \ | 162 | -Wint-conversion \ |
| 163 | -Wint-in-bool-context \ | ||
| 158 | -Wint-to-pointer-cast \ | 164 | -Wint-to-pointer-cast \ |
| 159 | -Winvalid-memory-model \ | 165 | -Winvalid-memory-model \ |
| 160 | -Winvalid-pch \ | 166 | -Winvalid-pch \ |
| @@ -163,6 +169,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 163 | -Wlogical-op \ | 169 | -Wlogical-op \ |
| 164 | -Wmain \ | 170 | -Wmain \ |
| 165 | -Wmaybe-uninitialized \ | 171 | -Wmaybe-uninitialized \ |
| 172 | -Wmemset-elt-size \ | ||
| 166 | -Wmemset-transposed-args \ | 173 | -Wmemset-transposed-args \ |
| 167 | -Wmisleading-indentation \ | 174 | -Wmisleading-indentation \ |
| 168 | -Wmissing-braces \ | 175 | -Wmissing-braces \ |
| @@ -188,9 +195,12 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 188 | -Wpacked-bitfield-compat \ | 195 | -Wpacked-bitfield-compat \ |
| 189 | -Wparentheses \ | 196 | -Wparentheses \ |
| 190 | -Wpointer-arith \ | 197 | -Wpointer-arith \ |
| 198 | -Wpointer-compare \ | ||
| 191 | -Wpointer-sign \ | 199 | -Wpointer-sign \ |
| 192 | -Wpointer-to-int-cast \ | 200 | -Wpointer-to-int-cast \ |
| 193 | -Wpragmas \ | 201 | -Wpragmas \ |
| 202 | -Wpsabi \ | ||
| 203 | -Wrestrict \ | ||
| 194 | -Wreturn-local-addr \ | 204 | -Wreturn-local-addr \ |
| 195 | -Wreturn-type \ | 205 | -Wreturn-type \ |
| 196 | -Wscalar-storage-order \ | 206 | -Wscalar-storage-order \ |
| @@ -214,6 +224,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 214 | -Wswitch \ | 224 | -Wswitch \ |
| 215 | -Wswitch-bool \ | 225 | -Wswitch-bool \ |
| 216 | -Wswitch-default \ | 226 | -Wswitch-default \ |
| 227 | -Wswitch-unreachable \ | ||
| 217 | -Wsync-nand \ | 228 | -Wsync-nand \ |
| 218 | -Wsystem-headers \ | 229 | -Wsystem-headers \ |
| 219 | -Wtautological-compare \ | 230 | -Wtautological-compare \ |
| @@ -247,10 +258,18 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], | |||
| 247 | 258 | ||
| 248 | # gcc --help=warnings outputs an unusual form for these options; list | 259 | # gcc --help=warnings outputs an unusual form for these options; list |
| 249 | # them here so that the above 'comm' command doesn't report a false match. | 260 | # them here so that the above 'comm' command doesn't report a false match. |
| 261 | # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal: | ||
| 262 | ptrdiff_max_max=9223372036854775807 | ||
| 263 | gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$ptrdiff_max_max" | ||
| 250 | gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" | 264 | gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" |
| 265 | gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" | ||
| 266 | gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" | ||
| 267 | gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" | ||
| 251 | gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" | 268 | gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" |
| 252 | gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" | 269 | gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" |
| 270 | gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" | ||
| 253 | gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" | 271 | gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" |
| 272 | gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" | ||
| 254 | 273 | ||
| 255 | # These are needed for older GCC versions. | 274 | # These are needed for older GCC versions. |
| 256 | if test -n "$GCC"; then | 275 | if test -n "$GCC"; then |