GNU bug report logs -
#8512
possibly uninitialized variable in x_produce_glyphs
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Sat, 16 Apr 2011 19:42:02 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8512 in the body.
You can then email your comments to 8512 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8512
; Package
emacs
.
(Sat, 16 Apr 2011 19:42:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Paul Eggert <eggert <at> cs.ucla.edu>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 16 Apr 2011 19:42:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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;
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8512
; Package
emacs
.
(Sat, 16 Apr 2011 21:27:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 8512 <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 16 Apr 2011 12:40:36 -0700
> From: Paul Eggert <eggert <at> 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.
Reply sent
to
Paul Eggert <eggert <at> cs.ucla.edu>
:
You have taken responsibility.
(Sat, 16 Apr 2011 22:50:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Paul Eggert <eggert <at> cs.ucla.edu>
:
bug acknowledged by developer.
(Sat, 16 Apr 2011 22:50:03 GMT)
Full text and
rfc822 format available.
Message #13 received at 8512-done <at> debbugs.gnu.org (full text, mbox):
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 :-).
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 15 May 2011 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 94 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.