GNU bug report logs - #8697
possibly-uninitialized variables in find_automatic_composition

Previous Next

Package: emacs;

Reported by: handa <handa <at> m17n.org>

Date: Thu, 19 May 2011 01:34:02 UTC

Severity: minor

Merged with 8290

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 8697 in the body.
You can then email your comments to 8697 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8697; Package emacs. (Thu, 19 May 2011 01:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to handa <handa <at> m17n.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 19 May 2011 01:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: handa <handa <at> m17n.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: possibly-uninitialized variables in find_automatic_composition
Date: Thu, 19 May 2011 10:32:54 +0900
Very sorry for the late response on this matter.

In article <4D841112.50403 <at> cs.ucla.edu>, Paul Eggert <eggert <at> cs.ucla.edu> writes:

> In the Emacs trunk, src/composite.c's find_automatic_composition has
> two local variables 'check' and 'prev' that gcc -Wuninitialized warns
> as being possibly being uninitialized when used.  This function has
> multiple gotos and dependencies on data structures that I don't
> understand, so it's not clear to me that GCC is wrong here.  So I'm
> filing a bug report in the hopes that someone more expert can look at it.

> I plan to work around the diagnostic by committing the following
> change, which adds a FIXME comment asking for initial value if needed,
> and for the comment to be removed if the code is OK as-is.  IF_LINT
> is used to tell GCC not to issue a warning here, for now.

> I'm CC:ing this to Kenichi Handa, who committed the code in question,
> to give him a heads-up about the problem.

Actually, those local variables are surely initialized when
used.  But as they are initialized under a specific
condition (e.g. check_val is set to non-nil) and used under
the same condition, it's difficult for gcc to detect that.

Anyway, I've just committed an inproved version of
find_automatic_composition, and gcc won't complain about it
now.

2011-05-18  Kenichi Handa  <handa <at> m17n.org>

	* composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
	(BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
	(find_automatic_composition): Mostly rewrite for efficiency.

---
Kenichi Handa
handa <at> m17n.org




Forcibly Merged 8290 8697. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 19 May 2011 05:42:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Jun 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.