From: Paul Eggert Date: Sat, 9 Sep 2017 00:29:57 +0000 (-0700) Subject: Port --enable-gcc-warnings to GCC 7 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1985e9dcbb4ebc4df651decfdad72fae7cff3ed3;p=emacs.git Port --enable-gcc-warnings to GCC 7 Do not merge to master. * configure.ac: Pacify GCC 7 with -Wno-bool-operation -Wno-implicit-fallthrough. * 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. --- diff --git a/configure.ac b/configure.ac index 4beda6530e5..2ccfca4336c 100644 --- a/configure.ac +++ b/configure.ac @@ -953,6 +953,8 @@ AS_IF([test "$gl_gcc_warnings" != yes], gl_WARN_ADD([$w]) done gl_WARN_ADD([-Wredundant-decls]) # Prefer this, as we don't use Bison. + gl_WARN_ADD([-Wno-bool-operation]) # Emacs 26 is clean, 25 is not. + gl_WARN_ADD([-Wno-implicit-fallthrough]) # Emacs 26 is clean, 25 is not. gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now gl_WARN_ADD([-Wno-type-limits]) # Too many warnings for now diff --git a/src/search.c b/src/search.c index 0793f9a8fb7..e676aac7339 100644 --- a/src/search.c +++ b/src/search.c @@ -1833,6 +1833,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, { /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a byte following them are the target of translation. */ + eassume (0x80 <= char_base && char_base <= MAX_CHAR); unsigned char str[MAX_MULTIBYTE_LENGTH]; int cblen = CHAR_STRING (char_base, str); diff --git a/src/xterm.c b/src/xterm.c index 74e1a5a6e8f..988e98d6c7c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1911,6 +1911,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s) } else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE) { + eassume (glyph->u.glyphless.ch <= MAX_CHAR); sprintf (buf, "%0*X", glyph->u.glyphless.ch < 0x10000 ? 4 : 6, glyph->u.glyphless.ch + 0u);