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

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

[Emacs-bug-tracker] bug#8512: closed (possibly uninitialized variable in


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8512: closed (possibly uninitialized variable in x_produce_glyphs)
Date: Sat, 16 Apr 2011 22:50:03 +0000

Your message dated Sat, 16 Apr 2011 15:49:40 -0700
with message-id <address@hidden>
and subject line Re: bug#8512: possibly uninitialized variable in 
x_produce_glyphs
has caused the GNU bug report #8512,
regarding possibly uninitialized variable in x_produce_glyphs
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
8512: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8512
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 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;




--- End Message ---
--- Begin Message --- Subject: Re: bug#8512: possibly uninitialized variable in x_produce_glyphs Date: Sat, 16 Apr 2011 15:49:40 -0700 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8
On 04/16/2011 02:24 PM, Eli Zaretskii wrote:
> I don't think it matters how you initialize c here, because
> cmp->glyph_len can never be zero there.

Thanks, it was hard for me to tell that.  I'll mark this as
done, then.  I'll add a comment in the code, since it's not
obvious (at least, not to me :-).


--- End Message ---

reply via email to

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