bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8512: possibly uninitialized variable in x_produce_glyphs


From: Paul Eggert
Subject: bug#8512: possibly uninitialized variable in x_produce_glyphs
Date: Sat, 16 Apr 2011 12:40:36 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

In the Emacs trunk, GCC 3.4.3 on Solaris 10 warns about a possibly uninitialized
variable in x_produce_glyphs, and it's not clear to me that this diagnostic is
wrong.  The function assumes that cmp->glyph_len > 0, but a quick look through 
the
rest of Emacs suggests that it's possible that it's zero.  To play it safe
until someone with more expertise about glyphs can look at the problem, I plan
to install this patch:

--- src/xdisp.c 2011-04-16 01:54:37 +0000
+++ src/xdisp.c 2011-04-16 19:24:11 +0000
@@ -22712,7 +22712,7 @@ x_produce_glyphs (struct it *it)
          int lbearing, rbearing;
          int i, width, ascent, descent;
          int left_padded = 0, right_padded = 0;
-         int c;
+         int c = 0; /* FIXME: Is 0 right here, when cmp->glyph_len == 0?  */
          XChar2b char2b;
          struct font_metrics *pcm;
          int font_not_found_p;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]