]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around GCC bug 81401
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 May 2018 19:59:59 +0000 (12:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 May 2018 20:00:31 +0000 (13:00 -0700)
* 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

index 4bdec7134f43032b725652e0668feb5b2fa93207..eb299c36759d352f460bef2f8d737941cea06256 100644 (file)
@@ -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)