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 | |
| 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.
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | doc/misc/texinfo.tex | 10 | ||||
| -rw-r--r-- | lib-src/ebrowse.c | 5 | ||||
| -rw-r--r-- | lib-src/etags.c | 28 | ||||
| -rw-r--r-- | lib/strftime.c | 13 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 2 | ||||
| -rw-r--r-- | m4/manywarnings.m4 | 25 | ||||
| -rw-r--r-- | src/bidi.c | 2 | ||||
| -rw-r--r-- | src/callint.c | 1 | ||||
| -rw-r--r-- | src/ccl.c | 4 | ||||
| -rw-r--r-- | src/coding.c | 4 | ||||
| -rw-r--r-- | src/conf_post.h | 6 | ||||
| -rw-r--r-- | src/data.c | 2 | ||||
| -rw-r--r-- | src/doprnt.c | 1 | ||||
| -rw-r--r-- | src/editfns.c | 10 | ||||
| -rw-r--r-- | src/eval.c | 20 | ||||
| -rw-r--r-- | src/filelock.c | 2 | ||||
| -rw-r--r-- | src/gnutls.c | 1 | ||||
| -rw-r--r-- | src/gtkutil.c | 14 | ||||
| -rw-r--r-- | src/indent.c | 1 | ||||
| -rw-r--r-- | src/lread.c | 10 | ||||
| -rw-r--r-- | src/regex.c | 8 | ||||
| -rw-r--r-- | src/search.c | 1 | ||||
| -rw-r--r-- | src/syntax.c | 8 | ||||
| -rw-r--r-- | src/xterm.c | 8 |
25 files changed, 118 insertions, 70 deletions
diff --git a/configure.ac b/configure.ac index d085552ffea..34b75a768bf 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -921,6 +921,8 @@ AS_IF([test $gl_gcc_warnings = no], | |||
| 921 | [gl_WARN_ADD([-Werror], [WERROR_CFLAGS])]) | 921 | [gl_WARN_ADD([-Werror], [WERROR_CFLAGS])]) |
| 922 | AC_SUBST([WERROR_CFLAGS]) | 922 | AC_SUBST([WERROR_CFLAGS]) |
| 923 | 923 | ||
| 924 | nw="$nw -Wduplicated-branches" # Too many false alarms | ||
| 925 | nw="$nw -Wformat-overflow=2" # False alarms due to GCC bug 80776 | ||
| 924 | nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings | 926 | nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings |
| 925 | nw="$nw -Woverlength-strings" # Not a problem these days | 927 | nw="$nw -Woverlength-strings" # Not a problem these days |
| 926 | nw="$nw -Wformat-nonliteral" # we do this a lot | 928 | nw="$nw -Wformat-nonliteral" # we do this a lot |
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 9cd73101c1f..8204f3e3aeb 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | % Load plain if necessary, i.e., if running under initex. | 3 | % Load plain if necessary, i.e., if running under initex. |
| 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
| 5 | % | 5 | % |
| 6 | \def\texinfoversion{2017-04-14.11} | 6 | \def\texinfoversion{2017-05-14.14} |
| 7 | % | 7 | % |
| 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, | 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, |
| 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
| @@ -9118,7 +9118,13 @@ end | |||
| 9118 | \xdef\safexrefname{#1}% | 9118 | \xdef\safexrefname{#1}% |
| 9119 | }% | 9119 | }% |
| 9120 | % | 9120 | % |
| 9121 | \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref | 9121 | \bgroup |
| 9122 | \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% | ||
| 9123 | \egroup | ||
| 9124 | % We put the \gdef inside a group to avoid the definitions building up on | ||
| 9125 | % TeX's save stack, which can cause it to run out of space for aux files with | ||
| 9126 | % thousands of lines. \gdef doesn't use the save stack, but \csname does | ||
| 9127 | % when it defines an unknown control sequence as \relax. | ||
| 9122 | % | 9128 | % |
| 9123 | % Was that xref control sequence that we just defined for a float? | 9129 | % Was that xref control sequence that we just defined for a float? |
| 9124 | \expandafter\iffloat\csname XR\safexrefname\endcsname | 9130 | \expandafter\iffloat\csname XR\safexrefname\endcsname |
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 623911027ce..51d181997b1 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c | |||
| @@ -3059,8 +3059,7 @@ class_definition (struct sym *containing, int tag, int flags, int nested) | |||
| 3059 | MATCH until we see something like `;' or `{'. */ | 3059 | MATCH until we see something like `;' or `{'. */ |
| 3060 | while (!LOOKING_AT3 (';', YYEOF, '{')) | 3060 | while (!LOOKING_AT3 (';', YYEOF, '{')) |
| 3061 | MATCH (); | 3061 | MATCH (); |
| 3062 | done = 1; | 3062 | FALLTHROUGH; |
| 3063 | |||
| 3064 | case '{': | 3063 | case '{': |
| 3065 | done = 1; | 3064 | done = 1; |
| 3066 | break; | 3065 | break; |
| @@ -3184,7 +3183,7 @@ declaration (int flags) | |||
| 3184 | free (id); | 3183 | free (id); |
| 3185 | return; | 3184 | return; |
| 3186 | } | 3185 | } |
| 3187 | 3186 | FALLTHROUGH; | |
| 3188 | case '=': | 3187 | case '=': |
| 3189 | /* Assumed to be the start of an initialization in this | 3188 | /* Assumed to be the start of an initialization in this |
| 3190 | context. */ | 3189 | context. */ |
diff --git a/lib-src/etags.c b/lib-src/etags.c index 015cbbe0ef3..6f280d8ab40 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -1157,7 +1157,7 @@ main (int argc, char **argv) | |||
| 1157 | case 'c': | 1157 | case 'c': |
| 1158 | /* Backward compatibility: support obsolete --ignore-case-regexp. */ | 1158 | /* Backward compatibility: support obsolete --ignore-case-regexp. */ |
| 1159 | optarg = concat (optarg, "i", ""); /* memory leak here */ | 1159 | optarg = concat (optarg, "i", ""); /* memory leak here */ |
| 1160 | /* FALLTHRU */ | 1160 | FALLTHROUGH; |
| 1161 | case 'r': | 1161 | case 'r': |
| 1162 | argbuffer[current_arg].arg_type = at_regexp; | 1162 | argbuffer[current_arg].arg_type = at_regexp; |
| 1163 | argbuffer[current_arg].what = optarg; | 1163 | argbuffer[current_arg].what = optarg; |
| @@ -1192,7 +1192,7 @@ main (int argc, char **argv) | |||
| 1192 | case 't': typedefs = true; break; | 1192 | case 't': typedefs = true; break; |
| 1193 | case 'T': typedefs = typedefs_or_cplusplus = true; break; | 1193 | case 'T': typedefs = typedefs_or_cplusplus = true; break; |
| 1194 | case 'u': update = true; break; | 1194 | case 'u': update = true; break; |
| 1195 | case 'v': vgrind_style = true; /*FALLTHRU*/ | 1195 | case 'v': vgrind_style = true; FALLTHROUGH; |
| 1196 | case 'x': cxref_style = true; break; | 1196 | case 'x': cxref_style = true; break; |
| 1197 | case 'w': no_warnings = true; break; | 1197 | case 'w': no_warnings = true; break; |
| 1198 | default: | 1198 | default: |
| @@ -2564,7 +2564,7 @@ hash (const char *str, int len) | |||
| 2564 | { | 2564 | { |
| 2565 | default: | 2565 | default: |
| 2566 | hval += asso_values[(unsigned char) str[2]]; | 2566 | hval += asso_values[(unsigned char) str[2]]; |
| 2567 | /*FALLTHROUGH*/ | 2567 | FALLTHROUGH; |
| 2568 | case 2: | 2568 | case 2: |
| 2569 | hval += asso_values[(unsigned char) str[1]]; | 2569 | hval += asso_values[(unsigned char) str[1]]; |
| 2570 | break; | 2570 | break; |
| @@ -3013,7 +3013,7 @@ consider_token (char *str, int len, int c, int *c_extp, | |||
| 3013 | *c_extp = (*c_extp | C_PLPL) & ~C_AUTO; | 3013 | *c_extp = (*c_extp | C_PLPL) & ~C_AUTO; |
| 3014 | if (toktype == st_C_template) | 3014 | if (toktype == st_C_template) |
| 3015 | break; | 3015 | break; |
| 3016 | /* FALLTHRU */ | 3016 | FALLTHROUGH; |
| 3017 | case st_C_struct: | 3017 | case st_C_struct: |
| 3018 | case st_C_enum: | 3018 | case st_C_enum: |
| 3019 | if (parlev == 0 | 3019 | if (parlev == 0 |
| @@ -3176,7 +3176,7 @@ consider_token (char *str, int len, int c, int *c_extp, | |||
| 3176 | default: | 3176 | default: |
| 3177 | break; | 3177 | break; |
| 3178 | } | 3178 | } |
| 3179 | /* FALLTHRU */ | 3179 | FALLTHROUGH; |
| 3180 | case fvnameseen: | 3180 | case fvnameseen: |
| 3181 | if (len >= 10 && strneq (str+len-10, "::operator", 10)) | 3181 | if (len >= 10 && strneq (str+len-10, "::operator", 10)) |
| 3182 | { | 3182 | { |
| @@ -3387,7 +3387,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 3387 | case '\0': | 3387 | case '\0': |
| 3388 | /* Hmmm, something went wrong. */ | 3388 | /* Hmmm, something went wrong. */ |
| 3389 | CNL (); | 3389 | CNL (); |
| 3390 | /* FALLTHRU */ | 3390 | FALLTHROUGH; |
| 3391 | case '\'': | 3391 | case '\'': |
| 3392 | inchar = false; | 3392 | inchar = false; |
| 3393 | break; | 3393 | break; |
| @@ -3828,7 +3828,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 3828 | || (members | 3828 | || (members |
| 3829 | && plainc && instruct)) | 3829 | && plainc && instruct)) |
| 3830 | make_C_tag (true); /* a function */ | 3830 | make_C_tag (true); /* a function */ |
| 3831 | /* FALLTHRU */ | 3831 | FALLTHROUGH; |
| 3832 | default: | 3832 | default: |
| 3833 | fvextern = false; | 3833 | fvextern = false; |
| 3834 | fvdef = fvnone; | 3834 | fvdef = fvnone; |
| @@ -3838,7 +3838,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 3838 | else | 3838 | else |
| 3839 | token.valid = false; | 3839 | token.valid = false; |
| 3840 | } /* switch (fvdef) */ | 3840 | } /* switch (fvdef) */ |
| 3841 | /* FALLTHRU */ | 3841 | FALLTHROUGH; |
| 3842 | default: | 3842 | default: |
| 3843 | if (!instruct) | 3843 | if (!instruct) |
| 3844 | typdef = tnone; | 3844 | typdef = tnone; |
| @@ -3926,7 +3926,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 3926 | || (globals && bracelev == 0 | 3926 | || (globals && bracelev == 0 |
| 3927 | && (!fvextern || declarations))) | 3927 | && (!fvextern || declarations))) |
| 3928 | make_C_tag (false); /* a variable */ | 3928 | make_C_tag (false); /* a variable */ |
| 3929 | /* FALLTHRU */ | 3929 | FALLTHROUGH; |
| 3930 | default: | 3930 | default: |
| 3931 | fvdef = fvnone; | 3931 | fvdef = fvnone; |
| 3932 | } | 3932 | } |
| @@ -3959,7 +3959,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 3959 | fvdef = fignore; | 3959 | fvdef = fignore; |
| 3960 | break; | 3960 | break; |
| 3961 | } | 3961 | } |
| 3962 | /* FALLTHRU */ | 3962 | FALLTHROUGH; |
| 3963 | case foperator: | 3963 | case foperator: |
| 3964 | fvdef = fstartlist; | 3964 | fvdef = fstartlist; |
| 3965 | break; | 3965 | break; |
| @@ -4049,7 +4049,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 4049 | } | 4049 | } |
| 4050 | } | 4050 | } |
| 4051 | make_C_tag (true); /* a function */ | 4051 | make_C_tag (true); /* a function */ |
| 4052 | /* FALLTHRU */ | 4052 | FALLTHROUGH; |
| 4053 | case fignore: | 4053 | case fignore: |
| 4054 | fvdef = fvnone; | 4054 | fvdef = fvnone; |
| 4055 | break; | 4055 | break; |
| @@ -4142,7 +4142,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 4142 | if ((members && bracelev == 1) | 4142 | if ((members && bracelev == 1) |
| 4143 | || (globals && bracelev == 0 && (!fvextern || declarations))) | 4143 | || (globals && bracelev == 0 && (!fvextern || declarations))) |
| 4144 | make_C_tag (false); /* a variable */ | 4144 | make_C_tag (false); /* a variable */ |
| 4145 | /* FALLTHRU */ | 4145 | FALLTHROUGH; |
| 4146 | default: | 4146 | default: |
| 4147 | fvdef = vignore; | 4147 | fvdef = vignore; |
| 4148 | } | 4148 | } |
| @@ -4169,7 +4169,7 @@ C_entries (int c_ext, FILE *inf) | |||
| 4169 | objdef = omethodsign; | 4169 | objdef = omethodsign; |
| 4170 | break; | 4170 | break; |
| 4171 | } | 4171 | } |
| 4172 | /* FALLTHRU */ | 4172 | FALLTHROUGH; |
| 4173 | resetfvdef: | 4173 | resetfvdef: |
| 4174 | case '#': case '~': case '&': case '%': case '/': | 4174 | case '#': case '~': case '&': case '%': case '/': |
| 4175 | case '|': case '^': case '!': case '.': case '?': | 4175 | case '|': case '^': case '!': case '.': case '?': |
| @@ -6354,7 +6354,7 @@ add_regex (char *regexp_pattern, language *lang) | |||
| 6354 | break; | 6354 | break; |
| 6355 | case 's': | 6355 | case 's': |
| 6356 | single_line = true; | 6356 | single_line = true; |
| 6357 | /* FALLTHRU */ | 6357 | FALLTHROUGH; |
| 6358 | case 'm': | 6358 | case 'm': |
| 6359 | multi_line = true; | 6359 | multi_line = true; |
| 6360 | need_filebuf = true; | 6360 | need_filebuf = true; |
diff --git a/lib/strftime.c b/lib/strftime.c index e4d78ef7011..99bee4ef978 100644 --- a/lib/strftime.c +++ b/lib/strftime.c | |||
| @@ -68,6 +68,14 @@ extern char *tzname[]; | |||
| 68 | #include <string.h> | 68 | #include <string.h> |
| 69 | #include <stdbool.h> | 69 | #include <stdbool.h> |
| 70 | 70 | ||
| 71 | #ifndef FALLTHROUGH | ||
| 72 | # if __GNUC__ < 7 | ||
| 73 | # define FALLTHROUGH ((void) 0) | ||
| 74 | # else | ||
| 75 | # define FALLTHROUGH __attribute__ ((__fallthrough__)) | ||
| 76 | # endif | ||
| 77 | #endif | ||
| 78 | |||
| 71 | #ifdef COMPILE_WIDE | 79 | #ifdef COMPILE_WIDE |
| 72 | # include <endian.h> | 80 | # include <endian.h> |
| 73 | # define CHAR_T wchar_t | 81 | # define CHAR_T wchar_t |
| @@ -1138,8 +1146,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) | |||
| 1138 | #ifndef _NL_CURRENT | 1146 | #ifndef _NL_CURRENT |
| 1139 | format_char = L_('p'); | 1147 | format_char = L_('p'); |
| 1140 | #endif | 1148 | #endif |
| 1141 | /* FALLTHROUGH */ | 1149 | FALLTHROUGH; |
| 1142 | |||
| 1143 | case L_('p'): | 1150 | case L_('p'): |
| 1144 | if (change_case) | 1151 | if (change_case) |
| 1145 | { | 1152 | { |
| @@ -1474,7 +1481,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) | |||
| 1474 | 1481 | ||
| 1475 | case L_('\0'): /* GNU extension: % at end of format. */ | 1482 | case L_('\0'): /* GNU extension: % at end of format. */ |
| 1476 | --f; | 1483 | --f; |
| 1477 | /* Fall through. */ | 1484 | FALLTHROUGH; |
| 1478 | default: | 1485 | default: |
| 1479 | /* Unknown format; output the format, including the '%', | 1486 | /* Unknown format; output the format, including the '%', |
| 1480 | since this is most likely the right thing to do if a | 1487 | since this is most likely the right thing to do if a |
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 |
diff --git a/src/bidi.c b/src/bidi.c index b75ad933626..dce0bf695f6 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -2092,7 +2092,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it) | |||
| 2092 | type = RLI; | 2092 | type = RLI; |
| 2093 | bidi_it->orig_type = type; | 2093 | bidi_it->orig_type = type; |
| 2094 | } | 2094 | } |
| 2095 | /* FALLTHROUGH */ | 2095 | FALLTHROUGH; |
| 2096 | case RLI: /* X5a */ | 2096 | case RLI: /* X5a */ |
| 2097 | if (override == NEUTRAL_DIR) | 2097 | if (override == NEUTRAL_DIR) |
| 2098 | bidi_it->type_after_wn = type; | 2098 | bidi_it->type_after_wn = type; |
diff --git a/src/callint.c b/src/callint.c index d96454883cf..96436116c8b 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -690,6 +690,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 690 | case 'N': /* Prefix arg as number, else number from minibuffer. */ | 690 | case 'N': /* Prefix arg as number, else number from minibuffer. */ |
| 691 | if (!NILP (prefix_arg)) | 691 | if (!NILP (prefix_arg)) |
| 692 | goto have_prefix_arg; | 692 | goto have_prefix_arg; |
| 693 | FALLTHROUGH; | ||
| 693 | case 'n': /* Read number from minibuffer. */ | 694 | case 'n': /* Read number from minibuffer. */ |
| 694 | args[i] = call1 (Qread_number, callint_message); | 695 | args[i] = call1 (Qread_number, callint_message); |
| 695 | /* Passing args[i] directly stimulates compiler bug. */ | 696 | /* Passing args[i] directly stimulates compiler bug. */ |
| @@ -1000,7 +1000,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size | |||
| 1000 | 1000 | ||
| 1001 | case CCL_ReadBranch: /* CCCCCCCCCCCCCCCCCCCCrrrXXXXX */ | 1001 | case CCL_ReadBranch: /* CCCCCCCCCCCCCCCCCCCCrrrXXXXX */ |
| 1002 | CCL_READ_CHAR (reg[rrr]); | 1002 | CCL_READ_CHAR (reg[rrr]); |
| 1003 | /* fall through ... */ | 1003 | FALLTHROUGH; |
| 1004 | case CCL_Branch: /* CCCCCCCCCCCCCCCCCCCCrrrXXXXX */ | 1004 | case CCL_Branch: /* CCCCCCCCCCCCCCCCCCCCrrrXXXXX */ |
| 1005 | { | 1005 | { |
| 1006 | int ioff = 0 <= reg[rrr] && reg[rrr] < field1 ? reg[rrr] : field1; | 1006 | int ioff = 0 <= reg[rrr] && reg[rrr] < field1 ? reg[rrr] : field1; |
| @@ -1174,6 +1174,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size | |||
| 1174 | 1174 | ||
| 1175 | case CCL_ReadJumpCondExprConst: /* A--D--D--R--E--S--S-rrrXXXXX */ | 1175 | case CCL_ReadJumpCondExprConst: /* A--D--D--R--E--S--S-rrrXXXXX */ |
| 1176 | CCL_READ_CHAR (reg[rrr]); | 1176 | CCL_READ_CHAR (reg[rrr]); |
| 1177 | FALLTHROUGH; | ||
| 1177 | case CCL_JumpCondExprConst: /* A--D--D--R--E--S--S-rrrXXXXX */ | 1178 | case CCL_JumpCondExprConst: /* A--D--D--R--E--S--S-rrrXXXXX */ |
| 1178 | i = reg[rrr]; | 1179 | i = reg[rrr]; |
| 1179 | jump_address = ic + ADDR; | 1180 | jump_address = ic + ADDR; |
| @@ -1184,6 +1185,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size | |||
| 1184 | 1185 | ||
| 1185 | case CCL_ReadJumpCondExprReg: /* A--D--D--R--E--S--S-rrrXXXXX */ | 1186 | case CCL_ReadJumpCondExprReg: /* A--D--D--R--E--S--S-rrrXXXXX */ |
| 1186 | CCL_READ_CHAR (reg[rrr]); | 1187 | CCL_READ_CHAR (reg[rrr]); |
| 1188 | FALLTHROUGH; | ||
| 1187 | case CCL_JumpCondExprReg: | 1189 | case CCL_JumpCondExprReg: |
| 1188 | i = reg[rrr]; | 1190 | i = reg[rrr]; |
| 1189 | jump_address = ic + ADDR; | 1191 | jump_address = ic + ADDR; |
diff --git a/src/coding.c b/src/coding.c index 367a9759848..5682fc015ad 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -3611,7 +3611,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3611 | || CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS) | 3611 | || CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS) |
| 3612 | goto invalid_code; | 3612 | goto invalid_code; |
| 3613 | /* This is a graphic character, we fall down ... */ | 3613 | /* This is a graphic character, we fall down ... */ |
| 3614 | 3614 | FALLTHROUGH; | |
| 3615 | case ISO_graphic_plane_1: | 3615 | case ISO_graphic_plane_1: |
| 3616 | if (charset_id_1 < 0) | 3616 | if (charset_id_1 < 0) |
| 3617 | goto invalid_code; | 3617 | goto invalid_code; |
| @@ -3646,6 +3646,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3646 | case ISO_single_shift_2_7: | 3646 | case ISO_single_shift_2_7: |
| 3647 | if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS)) | 3647 | if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS)) |
| 3648 | goto invalid_code; | 3648 | goto invalid_code; |
| 3649 | FALLTHROUGH; | ||
| 3649 | case ISO_single_shift_2: | 3650 | case ISO_single_shift_2: |
| 3650 | if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT)) | 3651 | if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT)) |
| 3651 | goto invalid_code; | 3652 | goto invalid_code; |
| @@ -3797,6 +3798,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3797 | { | 3798 | { |
| 3798 | case ']': /* end of the current direction */ | 3799 | case ']': /* end of the current direction */ |
| 3799 | coding->mode &= ~CODING_MODE_DIRECTION; | 3800 | coding->mode &= ~CODING_MODE_DIRECTION; |
| 3801 | break; | ||
| 3800 | 3802 | ||
| 3801 | case '0': /* end of the current direction */ | 3803 | case '0': /* end of the current direction */ |
| 3802 | case '1': /* start of left-to-right direction */ | 3804 | case '1': /* start of left-to-right direction */ |
diff --git a/src/conf_post.h b/src/conf_post.h index 95ebd5511ca..4fc0428df5a 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -244,6 +244,12 @@ extern int emacs_setenv_TZ (char const *); | |||
| 244 | # define ATTRIBUTE_FORMAT(spec) /* empty */ | 244 | # define ATTRIBUTE_FORMAT(spec) /* empty */ |
| 245 | #endif | 245 | #endif |
| 246 | 246 | ||
| 247 | #if GNUC_PREREQ (7, 0, 0) | ||
| 248 | # define FALLTHROUGH __attribute__ ((__fallthrough__)) | ||
| 249 | #else | ||
| 250 | # define FALLTHROUGH ((void) 0) | ||
| 251 | #endif | ||
| 252 | |||
| 247 | #if GNUC_PREREQ (4, 4, 0) && defined __GLIBC_MINOR__ | 253 | #if GNUC_PREREQ (4, 4, 0) && defined __GLIBC_MINOR__ |
| 248 | # define PRINTF_ARCHETYPE __gnu_printf__ | 254 | # define PRINTF_ARCHETYPE __gnu_printf__ |
| 249 | #elif GNUC_PREREQ (4, 4, 0) && defined __MINGW32__ | 255 | #elif GNUC_PREREQ (4, 4, 0) && defined __MINGW32__ |
diff --git a/src/data.c b/src/data.c index 44f7ba0e881..3ff2a809744 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -2153,7 +2153,7 @@ If the current binding is global (the default), the value is nil. */) | |||
| 2153 | else if (!BUFFER_OBJFWDP (valcontents)) | 2153 | else if (!BUFFER_OBJFWDP (valcontents)) |
| 2154 | return Qnil; | 2154 | return Qnil; |
| 2155 | } | 2155 | } |
| 2156 | /* FALLTHROUGH */ | 2156 | FALLTHROUGH; |
| 2157 | case SYMBOL_LOCALIZED: | 2157 | case SYMBOL_LOCALIZED: |
| 2158 | /* For a local variable, record both the symbol and which | 2158 | /* For a local variable, record both the symbol and which |
| 2159 | buffer's or frame's value we are saving. */ | 2159 | buffer's or frame's value we are saving. */ |
diff --git a/src/doprnt.c b/src/doprnt.c index 09051adc053..bed9350f4a6 100644 --- a/src/doprnt.c +++ b/src/doprnt.c | |||
| @@ -352,6 +352,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, | |||
| 352 | 352 | ||
| 353 | case 'S': | 353 | case 'S': |
| 354 | string[-1] = 's'; | 354 | string[-1] = 's'; |
| 355 | FALLTHROUGH; | ||
| 355 | case 's': | 356 | case 's': |
| 356 | if (fmtcpy[1] != 's') | 357 | if (fmtcpy[1] != 's') |
| 357 | minlen = atoi (&fmtcpy[1]); | 358 | minlen = atoi (&fmtcpy[1]); |
diff --git a/src/editfns.c b/src/editfns.c index 38530437a2f..ecb8e3f0838 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1595,10 +1595,10 @@ time_arith (Lisp_Object a, Lisp_Object b, | |||
| 1595 | { | 1595 | { |
| 1596 | default: | 1596 | default: |
| 1597 | val = Fcons (make_number (t.ps), val); | 1597 | val = Fcons (make_number (t.ps), val); |
| 1598 | /* Fall through. */ | 1598 | FALLTHROUGH; |
| 1599 | case 3: | 1599 | case 3: |
| 1600 | val = Fcons (make_number (t.us), val); | 1600 | val = Fcons (make_number (t.us), val); |
| 1601 | /* Fall through. */ | 1601 | FALLTHROUGH; |
| 1602 | case 2: | 1602 | case 2: |
| 1603 | val = Fcons (make_number (t.lo), val); | 1603 | val = Fcons (make_number (t.lo), val); |
| 1604 | val = Fcons (make_number (t.hi), val); | 1604 | val = Fcons (make_number (t.hi), val); |
| @@ -4072,8 +4072,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 4072 | } | 4072 | } |
| 4073 | 4073 | ||
| 4074 | /* Ignore flags when sprintf ignores them. */ | 4074 | /* Ignore flags when sprintf ignores them. */ |
| 4075 | space_flag &= ~ plus_flag; | 4075 | space_flag &= ! plus_flag; |
| 4076 | zero_flag &= ~ minus_flag; | 4076 | zero_flag &= ! minus_flag; |
| 4077 | 4077 | ||
| 4078 | char *num_end; | 4078 | char *num_end; |
| 4079 | uintmax_t raw_field_width = strtoumax (format, &num_end, 10); | 4079 | uintmax_t raw_field_width = strtoumax (format, &num_end, 10); |
| @@ -4311,7 +4311,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 4311 | { | 4311 | { |
| 4312 | memcpy (f, pMd, pMlen); | 4312 | memcpy (f, pMd, pMlen); |
| 4313 | f += pMlen; | 4313 | f += pMlen; |
| 4314 | zero_flag &= ~ precision_given; | 4314 | zero_flag &= ! precision_given; |
| 4315 | } | 4315 | } |
| 4316 | *f++ = conversion; | 4316 | *f++ = conversion; |
| 4317 | *f = '\0'; | 4317 | *f = '\0'; |
diff --git a/src/eval.c b/src/eval.c index 848955c2794..98d25cc4fed 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -3212,7 +3212,7 @@ do_specbind (struct Lisp_Symbol *sym, union specbinding *bind, | |||
| 3212 | set_default_internal (specpdl_symbol (bind), value, bindflag); | 3212 | set_default_internal (specpdl_symbol (bind), value, bindflag); |
| 3213 | return; | 3213 | return; |
| 3214 | } | 3214 | } |
| 3215 | /* FALLTHROUGH */ | 3215 | FALLTHROUGH; |
| 3216 | case SYMBOL_LOCALIZED: | 3216 | case SYMBOL_LOCALIZED: |
| 3217 | set_internal (specpdl_symbol (bind), value, Qnil, bindflag); | 3217 | set_internal (specpdl_symbol (bind), value, Qnil, bindflag); |
| 3218 | break; | 3218 | break; |
| @@ -3390,12 +3390,10 @@ do_one_unbind (union specbinding *this_binding, bool unwinding, | |||
| 3390 | Qnil, bindflag); | 3390 | Qnil, bindflag); |
| 3391 | break; | 3391 | break; |
| 3392 | } | 3392 | } |
| 3393 | else | ||
| 3394 | { /* FALLTHROUGH!! | ||
| 3395 | NOTE: we only ever come here if make_local_foo was used for | ||
| 3396 | the first time on this var within this let. */ | ||
| 3397 | } | ||
| 3398 | } | 3393 | } |
| 3394 | /* Come here only if make_local_foo was used for the first time | ||
| 3395 | on this var within this let. */ | ||
| 3396 | FALLTHROUGH; | ||
| 3399 | case SPECPDL_LET_DEFAULT: | 3397 | case SPECPDL_LET_DEFAULT: |
| 3400 | set_default_internal (specpdl_symbol (this_binding), | 3398 | set_default_internal (specpdl_symbol (this_binding), |
| 3401 | specpdl_old_value (this_binding), | 3399 | specpdl_old_value (this_binding), |
| @@ -3676,12 +3674,10 @@ backtrace_eval_unrewind (int distance) | |||
| 3676 | SET_SYMBOL_VAL (XSYMBOL (sym), old_value); | 3674 | SET_SYMBOL_VAL (XSYMBOL (sym), old_value); |
| 3677 | break; | 3675 | break; |
| 3678 | } | 3676 | } |
| 3679 | else | ||
| 3680 | { /* FALLTHROUGH!! | ||
| 3681 | NOTE: we only ever come here if make_local_foo was used for | ||
| 3682 | the first time on this var within this let. */ | ||
| 3683 | } | ||
| 3684 | } | 3677 | } |
| 3678 | /* Come here only if make_local_foo was used for the first | ||
| 3679 | time on this var within this let. */ | ||
| 3680 | FALLTHROUGH; | ||
| 3685 | case SPECPDL_LET_DEFAULT: | 3681 | case SPECPDL_LET_DEFAULT: |
| 3686 | { | 3682 | { |
| 3687 | Lisp_Object sym = specpdl_symbol (tmp); | 3683 | Lisp_Object sym = specpdl_symbol (tmp); |
| @@ -3837,7 +3833,7 @@ mark_specpdl (union specbinding *first, union specbinding *ptr) | |||
| 3837 | case SPECPDL_LET_DEFAULT: | 3833 | case SPECPDL_LET_DEFAULT: |
| 3838 | case SPECPDL_LET_LOCAL: | 3834 | case SPECPDL_LET_LOCAL: |
| 3839 | mark_object (specpdl_where (pdl)); | 3835 | mark_object (specpdl_where (pdl)); |
| 3840 | /* Fall through. */ | 3836 | FALLTHROUGH; |
| 3841 | case SPECPDL_LET: | 3837 | case SPECPDL_LET: |
| 3842 | mark_object (specpdl_symbol (pdl)); | 3838 | mark_object (specpdl_symbol (pdl)); |
| 3843 | mark_object (specpdl_old_value (pdl)); | 3839 | mark_object (specpdl_old_value (pdl)); |
diff --git a/src/filelock.c b/src/filelock.c index 67e8dbd34ed..bfa1d63d833 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -569,7 +569,7 @@ current_lock_owner (lock_info_type *owner, char *lfname) | |||
| 569 | if (! (boot[0] == '\200' && boot[1] == '\242')) | 569 | if (! (boot[0] == '\200' && boot[1] == '\242')) |
| 570 | return -1; | 570 | return -1; |
| 571 | boot += 2; | 571 | boot += 2; |
| 572 | /* Fall through. */ | 572 | FALLTHROUGH; |
| 573 | case ':': | 573 | case ':': |
| 574 | if (! c_isdigit (boot[0])) | 574 | if (! c_isdigit (boot[0])) |
| 575 | return -1; | 575 | return -1; |
diff --git a/src/gnutls.c b/src/gnutls.c index 28ab10de05c..2078ad88f28 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -605,6 +605,7 @@ emacs_gnutls_handle_error (gnutls_session_t session, int err) | |||
| 605 | max_log_level, | 605 | max_log_level, |
| 606 | "retry:", | 606 | "retry:", |
| 607 | str); | 607 | str); |
| 608 | FALLTHROUGH; | ||
| 608 | default: | 609 | default: |
| 609 | GNUTLS_LOG2 (1, | 610 | GNUTLS_LOG2 (1, |
| 610 | max_log_level, | 611 | max_log_level, |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 1b63293fe55..16eb284d7c7 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -554,10 +554,11 @@ xg_check_special_colors (struct frame *f, | |||
| 554 | else | 554 | else |
| 555 | gtk_style_context_get_background_color (gsty, state, &col); | 555 | gtk_style_context_get_background_color (gsty, state, &col); |
| 556 | 556 | ||
| 557 | sprintf (buf, "rgb:%04x/%04x/%04x", | 557 | unsigned short |
| 558 | (unsigned) (col.red * 65535), | 558 | r = col.red * 65535, |
| 559 | (unsigned) (col.green * 65535), | 559 | g = col.green * 65535, |
| 560 | (unsigned) (col.blue * 65535)); | 560 | b = col.blue * 65535; |
| 561 | sprintf (buf, "rgb:%04x/%04x/%04x", r, g, b); | ||
| 561 | success_p = x_parse_color (f, buf, color) != 0; | 562 | success_p = x_parse_color (f, buf, color) != 0; |
| 562 | #else | 563 | #else |
| 563 | GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f)); | 564 | GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f)); |
| @@ -3856,7 +3857,6 @@ xg_update_scrollbar_pos (struct frame *f, | |||
| 3856 | GtkWidget *wparent = gtk_widget_get_parent (wscroll); | 3857 | GtkWidget *wparent = gtk_widget_get_parent (wscroll); |
| 3857 | gint msl; | 3858 | gint msl; |
| 3858 | int scale = xg_get_gdk_scale (); | 3859 | int scale = xg_get_gdk_scale (); |
| 3859 | bool hidden; | ||
| 3860 | 3860 | ||
| 3861 | top /= scale; | 3861 | top /= scale; |
| 3862 | left /= scale; | 3862 | left /= scale; |
| @@ -3875,13 +3875,13 @@ xg_update_scrollbar_pos (struct frame *f, | |||
| 3875 | /* Move and resize to new values. */ | 3875 | /* Move and resize to new values. */ |
| 3876 | gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); | 3876 | gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); |
| 3877 | gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL); | 3877 | gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL); |
| 3878 | if (msl > height) | 3878 | bool hidden = height < msl; |
| 3879 | if (hidden) | ||
| 3879 | { | 3880 | { |
| 3880 | /* No room. Hide scroll bar as some themes output a warning if | 3881 | /* No room. Hide scroll bar as some themes output a warning if |
| 3881 | the height is less than the min size. */ | 3882 | the height is less than the min size. */ |
| 3882 | gtk_widget_hide (wparent); | 3883 | gtk_widget_hide (wparent); |
| 3883 | gtk_widget_hide (wscroll); | 3884 | gtk_widget_hide (wscroll); |
| 3884 | hidden = true; | ||
| 3885 | } | 3885 | } |
| 3886 | else | 3886 | else |
| 3887 | { | 3887 | { |
diff --git a/src/indent.c b/src/indent.c index f630ebb847c..adecc3622a8 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -925,6 +925,7 @@ position_indentation (ptrdiff_t pos_byte) | |||
| 925 | case 0240: | 925 | case 0240: |
| 926 | if (! NILP (BVAR (current_buffer, enable_multibyte_characters))) | 926 | if (! NILP (BVAR (current_buffer, enable_multibyte_characters))) |
| 927 | return column; | 927 | return column; |
| 928 | FALLTHROUGH; | ||
| 928 | case ' ': | 929 | case ' ': |
| 929 | column++; | 930 | column++; |
| 930 | break; | 931 | break; |
diff --git a/src/lread.c b/src/lread.c index c03aad4f722..5e737d690c6 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2309,6 +2309,7 @@ read_escape (Lisp_Object readcharfun, bool stringp) | |||
| 2309 | c = READCHAR; | 2309 | c = READCHAR; |
| 2310 | if (c != '-') | 2310 | if (c != '-') |
| 2311 | error ("Invalid escape character syntax"); | 2311 | error ("Invalid escape character syntax"); |
| 2312 | FALLTHROUGH; | ||
| 2312 | case '^': | 2313 | case '^': |
| 2313 | c = READCHAR; | 2314 | c = READCHAR; |
| 2314 | if (c == '\\') | 2315 | if (c == '\\') |
| @@ -2399,6 +2400,7 @@ read_escape (Lisp_Object readcharfun, bool stringp) | |||
| 2399 | case 'U': | 2400 | case 'U': |
| 2400 | /* Post-Unicode-2.0: Up to eight hex chars. */ | 2401 | /* Post-Unicode-2.0: Up to eight hex chars. */ |
| 2401 | unicode_hex_count = 8; | 2402 | unicode_hex_count = 8; |
| 2403 | FALLTHROUGH; | ||
| 2402 | case 'u': | 2404 | case 'u': |
| 2403 | 2405 | ||
| 2404 | /* A Unicode escape. We only permit them in strings and characters, | 2406 | /* A Unicode escape. We only permit them in strings and characters, |
| @@ -3278,11 +3280,11 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 3278 | *pch = c; | 3280 | *pch = c; |
| 3279 | return Qnil; | 3281 | return Qnil; |
| 3280 | } | 3282 | } |
| 3281 | |||
| 3282 | /* Otherwise, we fall through! Note that the atom-reading loop | ||
| 3283 | below will now loop at least once, assuring that we will not | ||
| 3284 | try to UNREAD two characters in a row. */ | ||
| 3285 | } | 3283 | } |
| 3284 | /* The atom-reading loop below will now loop at least once, | ||
| 3285 | assuring that we will not try to UNREAD two characters in a | ||
| 3286 | row. */ | ||
| 3287 | FALLTHROUGH; | ||
| 3286 | default: | 3288 | default: |
| 3287 | default_label: | 3289 | default_label: |
| 3288 | if (c <= 040) goto retry; | 3290 | if (c <= 040) goto retry; |
diff --git a/src/regex.c b/src/regex.c index 8e38a920cdb..ed848902086 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -2636,6 +2636,7 @@ regex_compile (const_re_char *pattern, size_t size, | |||
| 2636 | if ((syntax & RE_BK_PLUS_QM) | 2636 | if ((syntax & RE_BK_PLUS_QM) |
| 2637 | || (syntax & RE_LIMITED_OPS)) | 2637 | || (syntax & RE_LIMITED_OPS)) |
| 2638 | goto normal_char; | 2638 | goto normal_char; |
| 2639 | FALLTHROUGH; | ||
| 2639 | handle_plus: | 2640 | handle_plus: |
| 2640 | case '*': | 2641 | case '*': |
| 2641 | /* If there is no previous pattern... */ | 2642 | /* If there is no previous pattern... */ |
| @@ -3086,6 +3087,7 @@ regex_compile (const_re_char *pattern, size_t size, | |||
| 3086 | with non-0. */ | 3087 | with non-0. */ |
| 3087 | if (regnum == 0) | 3088 | if (regnum == 0) |
| 3088 | FREE_STACK_RETURN (REG_BADPAT); | 3089 | FREE_STACK_RETURN (REG_BADPAT); |
| 3090 | FALLTHROUGH; | ||
| 3089 | case '1': case '2': case '3': case '4': | 3091 | case '1': case '2': case '3': case '4': |
| 3090 | case '5': case '6': case '7': case '8': case '9': | 3092 | case '5': case '6': case '7': case '8': case '9': |
| 3091 | regnum = 10*regnum + (c - '0'); break; | 3093 | regnum = 10*regnum + (c - '0'); break; |
| @@ -3905,8 +3907,7 @@ analyze_first (const_re_char *p, const_re_char *pend, char *fastmap, | |||
| 3905 | j < (1 << BYTEWIDTH); j++) | 3907 | j < (1 << BYTEWIDTH); j++) |
| 3906 | fastmap[j] = 1; | 3908 | fastmap[j] = 1; |
| 3907 | } | 3909 | } |
| 3908 | 3910 | FALLTHROUGH; | |
| 3909 | /* Fallthrough */ | ||
| 3910 | case charset: | 3911 | case charset: |
| 3911 | if (!fastmap) break; | 3912 | if (!fastmap) break; |
| 3912 | not = (re_opcode_t) *(p - 1) == charset_not; | 3913 | not = (re_opcode_t) *(p - 1) == charset_not; |
| @@ -6182,8 +6183,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, | |||
| 6182 | case on_failure_jump_nastyloop: | 6183 | case on_failure_jump_nastyloop: |
| 6183 | assert ((re_opcode_t)pat[-2] == no_op); | 6184 | assert ((re_opcode_t)pat[-2] == no_op); |
| 6184 | PUSH_FAILURE_POINT (pat - 2, str); | 6185 | PUSH_FAILURE_POINT (pat - 2, str); |
| 6185 | /* Fallthrough */ | 6186 | FALLTHROUGH; |
| 6186 | |||
| 6187 | case on_failure_jump_loop: | 6187 | case on_failure_jump_loop: |
| 6188 | case on_failure_jump: | 6188 | case on_failure_jump: |
| 6189 | case succeed_n: | 6189 | case succeed_n: |
diff --git a/src/search.c b/src/search.c index 1223cbf07cc..19e789dfa87 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -1804,6 +1804,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, | |||
| 1804 | { | 1804 | { |
| 1805 | /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a | 1805 | /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a |
| 1806 | byte following them are the target of translation. */ | 1806 | byte following them are the target of translation. */ |
| 1807 | eassume (0x80 <= char_base && char_base <= MAX_CHAR); | ||
| 1807 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 1808 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 1808 | int cblen = CHAR_STRING (char_base, str); | 1809 | int cblen = CHAR_STRING (char_base, str); |
| 1809 | 1810 | ||
diff --git a/src/syntax.c b/src/syntax.c index 7aa43e6e5c7..dcaca22f0e2 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -810,6 +810,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, | |||
| 810 | case Sstring_fence: | 810 | case Sstring_fence: |
| 811 | case Scomment_fence: | 811 | case Scomment_fence: |
| 812 | c = (code == Sstring_fence ? ST_STRING_STYLE : ST_COMMENT_STYLE); | 812 | c = (code == Sstring_fence ? ST_STRING_STYLE : ST_COMMENT_STYLE); |
| 813 | FALLTHROUGH; | ||
| 813 | case Sstring: | 814 | case Sstring: |
| 814 | /* Track parity of quotes. */ | 815 | /* Track parity of quotes. */ |
| 815 | if (string_style == -1) | 816 | if (string_style == -1) |
| @@ -2690,6 +2691,7 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) | |||
| 2690 | goto lose; | 2691 | goto lose; |
| 2691 | INC_BOTH (from, from_byte); | 2692 | INC_BOTH (from, from_byte); |
| 2692 | /* Treat following character as a word constituent. */ | 2693 | /* Treat following character as a word constituent. */ |
| 2694 | FALLTHROUGH; | ||
| 2693 | case Sword: | 2695 | case Sword: |
| 2694 | case Ssymbol: | 2696 | case Ssymbol: |
| 2695 | if (depth || !sexpflag) break; | 2697 | if (depth || !sexpflag) break; |
| @@ -2721,7 +2723,7 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) | |||
| 2721 | 2723 | ||
| 2722 | case Scomment_fence: | 2724 | case Scomment_fence: |
| 2723 | comstyle = ST_COMMENT_STYLE; | 2725 | comstyle = ST_COMMENT_STYLE; |
| 2724 | /* FALLTHROUGH */ | 2726 | FALLTHROUGH; |
| 2725 | case Scomment: | 2727 | case Scomment: |
| 2726 | if (!parse_sexp_ignore_comments) break; | 2728 | if (!parse_sexp_ignore_comments) break; |
| 2727 | UPDATE_SYNTAX_TABLE_FORWARD (from); | 2729 | UPDATE_SYNTAX_TABLE_FORWARD (from); |
| @@ -2753,7 +2755,7 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) | |||
| 2753 | goto close1; | 2755 | goto close1; |
| 2754 | } | 2756 | } |
| 2755 | mathexit = 1; | 2757 | mathexit = 1; |
| 2756 | 2758 | FALLTHROUGH; | |
| 2757 | case Sopen: | 2759 | case Sopen: |
| 2758 | if (!++depth) goto done; | 2760 | if (!++depth) goto done; |
| 2759 | break; | 2761 | break; |
| @@ -2909,7 +2911,7 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) | |||
| 2909 | goto open2; | 2911 | goto open2; |
| 2910 | } | 2912 | } |
| 2911 | mathexit = 1; | 2913 | mathexit = 1; |
| 2912 | 2914 | FALLTHROUGH; | |
| 2913 | case Sclose: | 2915 | case Sclose: |
| 2914 | if (!++depth) goto done2; | 2916 | if (!++depth) goto done2; |
| 2915 | break; | 2917 | break; |
diff --git a/src/xterm.c b/src/xterm.c index e9068830f85..c8836b7ca78 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2005,9 +2005,9 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s) | |||
| 2005 | } | 2005 | } |
| 2006 | else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE) | 2006 | else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE) |
| 2007 | { | 2007 | { |
| 2008 | sprintf (buf, "%0*X", | 2008 | unsigned int ch = glyph->u.glyphless.ch; |
| 2009 | glyph->u.glyphless.ch < 0x10000 ? 4 : 6, | 2009 | eassume (ch <= MAX_CHAR); |
| 2010 | glyph->u.glyphless.ch + 0u); | 2010 | sprintf (buf, "%0*X", ch < 0x10000 ? 4 : 6, ch); |
| 2011 | str = buf; | 2011 | str = buf; |
| 2012 | } | 2012 | } |
| 2013 | 2013 | ||
| @@ -8949,7 +8949,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 8949 | { | 8949 | { |
| 8950 | case MappingModifier: | 8950 | case MappingModifier: |
| 8951 | x_find_modifier_meanings (dpyinfo); | 8951 | x_find_modifier_meanings (dpyinfo); |
| 8952 | /* This is meant to fall through. */ | 8952 | FALLTHROUGH; |
| 8953 | case MappingKeyboard: | 8953 | case MappingKeyboard: |
| 8954 | XRefreshKeyboardMapping ((XMappingEvent *) &event->xmapping); | 8954 | XRefreshKeyboardMapping ((XMappingEvent *) &event->xmapping); |
| 8955 | } | 8955 | } |