From 2e1bebe279b7108f74c3a1e7e30e8a43c2cfa31f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 16 May 2017 10:24:19 -0700 Subject: Merge with gnulib, pacifying GCC 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- lib/strftime.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/strftime.c') 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[]; #include #include +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + #ifdef COMPILE_WIDE # include # define CHAR_T wchar_t @@ -1138,8 +1146,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) #ifndef _NL_CURRENT format_char = L_('p'); #endif - /* FALLTHROUGH */ - + FALLTHROUGH; case L_('p'): if (change_case) { @@ -1474,7 +1481,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) case L_('\0'): /* GNU extension: % at end of format. */ --f; - /* Fall through. */ + FALLTHROUGH; default: /* Unknown format; output the format, including the '%', since this is most likely the right thing to do if a -- cgit v1.2.1