From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 8512@debbugs.gnu.org
Subject: bug#8512: possibly uninitialized variable in x_produce_glyphs
Date: Sun, 17 Apr 2011 00:24:32 +0300 [thread overview]
Message-ID: <831v11q48f.fsf@gnu.org> (raw)
In-Reply-To: <4DA9F0B4.1090204@cs.ucla.edu>
> Date: Sat, 16 Apr 2011 12:40:36 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
>
> 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? */
I don't think it matters how you initialize c here, because
cmp->glyph_len can never be zero there. However, using c=0 here is
not right, I think; I would use a printable character, like ' ' or
something, so that get_char_face_and_encoding gets a real character to
play with.
next prev parent reply other threads:[~2011-04-16 21:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-16 19:40 bug#8512: possibly uninitialized variable in x_produce_glyphs Paul Eggert
2011-04-16 21:24 ` Eli Zaretskii [this message]
2011-04-16 22:49 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=831v11q48f.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=8512@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.