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

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sat, 19 Mar 2011 02:14:01 UTC

Severity: minor

Merged with 8697

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 8290 in the body.
You can then email your comments to 8290 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#8290; Package emacs. (Sat, 19 Mar 2011 02:14: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, 19 Mar 2011 02:14:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-gnu-emacs <at> gnu.org
Cc: Kenichi Handa <handa <at> m17n.org>
Subject: possibly-uninitialized variables in find_automatic_composition
Date: Fri, 18 Mar 2011 19:12:34 -0700
Severity: minor

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.


* composite.c (find_automatic_composition): Mark vars as initialized, with a FIXME.
=== modified file 'src/composite.c'
--- src/composite.c	2011-03-19 00:58:10 +0000
+++ src/composite.c	2011-03-19 01:02:12 +0000
@@ -1489,7 +1489,13 @@
   EMACS_INT head, tail, stop;
   /* Limit to check a composition after POS.  */
   EMACS_INT fore_check_limit;
-  struct position_record orig, cur, check, prev;
+  struct position_record orig, cur;
+
+  /* FIXME: It's not obvious whether these two variables need initialization.
+     If they do, please supply initial values.
+     If not, please remove this comment.  */
+  struct position_record check IF_LINT (= {0}), prev IF_LINT (= {0});
+
   Lisp_Object check_val, val, elt;
   int c;
   Lisp_Object window;





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Wed, 23 Mar 2011 22:07:08 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Wed, 23 Mar 2011 22:07:08 GMT) Full text and rfc822 format available.

Message #10 received at 8290-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 8310-done <at> debbugs.gnu.org, 8318-done <at> debbugs.gnu.org, 
	8306-done <at> debbugs.gnu.org, 8303-done <at> debbugs.gnu.org, 
	8277-done <at> debbugs.gnu.org, 8298-done <at> debbugs.gnu.org, 
	8290-done <at> debbugs.gnu.org, 8278-done <at> debbugs.gnu.org
Subject: fix merged to trunk
Date: Wed, 23 Mar 2011 15:06:46 -0700
I committed a fix to the trunk for this,
as part of a recent merge (bzr 103721).




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

bug unarchived. 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.

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.