From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#8211: uninitialized variable in detect_coding_iso_2022's end-of-composition code Date: Wed, 09 Mar 2011 23:30:21 +0100 Message-ID: References: <4D77BEA3.6070305@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1299710239 19695 80.91.229.12 (9 Mar 2011 22:37:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 22:37:19 +0000 (UTC) Cc: 8211@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 09 23:37:15 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PxS0I-0005Oz-HG for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Mar 2011 23:37:14 +0100 Original-Received: from localhost ([127.0.0.1]:35184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxS0I-0001Pj-0k for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Mar 2011 17:37:14 -0500 Original-Received: from [140.186.70.92] (port=47720 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxS03-0001LV-W7 for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2011 17:37:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxS02-0006eI-Nw for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2011 17:36:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxS02-0006eD-M7 for bug-gnu-emacs@gnu.org; Wed, 09 Mar 2011 17:36:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PxRuI-0001ZV-HJ; Wed, 09 Mar 2011 17:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Mar 2011 22:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8211 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8211-submit@debbugs.gnu.org id=B8211.12997098306004 (code B ref 8211); Wed, 09 Mar 2011 22:31:02 +0000 Original-Received: (at 8211) by debbugs.gnu.org; 9 Mar 2011 22:30:30 +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 1PxRtm-0001Yn-EA for submit@debbugs.gnu.org; Wed, 09 Mar 2011 17:30:30 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PxRtj-0001Yb-M3 for 8211@debbugs.gnu.org; Wed, 09 Mar 2011 17:30:28 -0500 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id CE7BA188A196; Wed, 9 Mar 2011 23:30:21 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 164161C0013E; Wed, 9 Mar 2011 23:30:22 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id AknjDKnufomn; Wed, 9 Mar 2011 23:30:21 +0100 (CET) Original-Received: from igel.home (ppp-93-104-142-221.dynamic.mnet-online.de [93.104.142.221]) by mail.mnet-online.de (Postfix) with ESMTP; Wed, 9 Mar 2011 23:30:21 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id 3C034CA2A0; Wed, 9 Mar 2011 23:30:21 +0100 (CET) X-Yow: Here I am in the POSTERIOR OLFACTORY LOBULE but I don't see CARL SAGAN anywhere!! In-Reply-To: <4D77BEA3.6070305@cs.ucla.edu> (Paul Eggert's message of "Wed, 09 Mar 2011 09:53:39 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 09 Mar 2011 17:31:02 -0500 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44827 Archived-At: Paul Eggert writes: > I found this problem by compiling Emacs with GCC's -Wuninitialized flag. > > The following code in the Emacs trunk src/coding.c's > detect_coding_iso_2022 function apparently uses an uninitialized variable: > > ... > else if (c == '1') > { > /* End of composition. */ > if (composition_count < 0 > || composition_count > MAX_COMPOSITION_COMPONENTS) > /* Invalid */ > break; > composition_count = -1; > found |= CATEGORY_MASK_ISO; > } > else > ... > > /* We found a valid designation sequence for CHARSET. */ > rejected |= CATEGORY_MASK_ISO_8BIT; > if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7], > id)) > found |= CATEGORY_MASK_ISO_7; > > The problem is that the "else if (c == '1')" branch does not initialize > the local variable "id", but the second "if" test uses that variable. I think it just lacks a break. ESC '1' is not a designation sequence. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."