summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-09-08 17:29:57 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-09-08 17:42:59 -0700
commit1985e9dcbb4ebc4df651decfdad72fae7cff3ed3 (patch)
treefd09387ef1f052463ed22d2a2b2a470c68bbd221
parent699a7ab7d990ab4011ce9296dcbf320ac0ab433d (diff)
downloademacs-1985e9dcbb4ebc4df651decfdad72fae7cff3ed3.tar.gz
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.
-rw-r--r--configure.ac2
-rw-r--r--src/search.c1
-rw-r--r--src/xterm.c1
3 files changed, 4 insertions, 0 deletions
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);