From fb9c52bb7d29c85f3baee770355260830dacea50 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 30 May 2018 12:59:59 -0700 Subject: [PATCH] Work around GCC bug 81401 * src/xterm.c (x_draw_glyphless_glyph_string_foreground): Make the buffer a byte longer than it needs to be, if --enable-gcc-warnings. --- src/xterm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xterm.c b/src/xterm.c index 4bdec7134f4..eb299c36759 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1973,7 +1973,13 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s) for (i = 0; i < s->nchars; i++, glyph++) { - char buf[7], *str = NULL; +#ifdef GCC_LINT + enum { PACIFY_GCC_BUG_81401 = 1 }; +#else + enum { PACIFY_GCC_BUG_81401 = 0 }; +#endif + char buf[7 + PACIFY_GCC_BUG_81401]; + char *str = NULL; int len = glyph->u.glyphless.len; if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_ACRONYM) -- 2.39.5