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.
This commit is contained in:
Paul Eggert 2017-09-08 17:29:57 -07:00
parent 699a7ab7d9
commit 1985e9dcbb
3 changed files with 4 additions and 0 deletions

View file

@ -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

View file

@ -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);

View file

@ -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);