From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: handa Newsgroups: gmane.emacs.bugs Subject: bug#8697: possibly-uninitialized variables in find_automatic_composition Date: Thu, 19 May 2011 10:32:54 +0900 Message-ID: References: <4D841112.50403@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1305768855 16147 80.91.229.12 (19 May 2011 01:34:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 May 2011 01:34:15 +0000 (UTC) Cc: 8697@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 19 03:34:08 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QMs7r-000172-D3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 May 2011 03:34:07 +0200 Original-Received: from localhost ([::1]:45130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMs7q-0006nz-Uc for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 May 2011 21:34:06 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMs7n-0006nm-I2 for bug-gnu-emacs@gnu.org; Wed, 18 May 2011 21:34:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMs7m-0002Y2-LU for bug-gnu-emacs@gnu.org; Wed, 18 May 2011 21:34:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMs7m-0002Xy-In for bug-gnu-emacs@gnu.org; Wed, 18 May 2011 21:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QMs7m-0001gN-Bj; Wed, 18 May 2011 21:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 May 2011 01:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8697 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13057688006413 (code B ref -1); Thu, 19 May 2011 01:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 May 2011 01:33:20 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMs76-0001fO-0U for submit@debbugs.gnu.org; Wed, 18 May 2011 21:33:20 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QMs73-0001f9-B7 for submit@debbugs.gnu.org; Wed, 18 May 2011 21:33:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMs6x-0002V2-BV for submit@debbugs.gnu.org; Wed, 18 May 2011 21:33:12 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:43762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMs6x-0002Uy-AD for submit@debbugs.gnu.org; Wed, 18 May 2011 21:33:11 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMs6w-0006n6-Az for bug-gnu-emacs@gnu.org; Wed, 18 May 2011 21:33:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMs6v-0002Uj-0D for bug-gnu-emacs@gnu.org; Wed, 18 May 2011 21:33:10 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:55451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMs6u-0002Ub-Gj for bug-gnu-emacs@gnu.org; Wed, 18 May 2011 21:33:08 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id p4J1Wtf4022733; Thu, 19 May 2011 10:32:55 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id p4J1WtmX016548; Thu, 19 May 2011 10:32:55 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id p4J1Ws9e002722; Thu, 19 May 2011 10:32:54 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.71) (envelope-from ) id 1QMs6g-0000iz-GW; Thu, 19 May 2011 10:32:54 +0900 In-Reply-To: <4D841112.50403@cs.ucla.edu> (message from Paul Eggert on Fri, 18 Mar 2011 19:12:34 -0700) Importance: high X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 18 May 2011 21:34:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46575 Archived-At: Very sorry for the late response on this matter. In article <4D841112.50403@cs.ucla.edu>, Paul Eggert 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 * 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@m17n.org