From: Paul Eggert Date: Tue, 8 Mar 2011 07:36:31 +0000 (-0800) Subject: * coding.c (detect_coding_iso_2022): Initialize a local variable that might X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~605^2^2~55 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=160b01f65a12a9e6893c270662d6ae249a1db300;p=emacs.git * coding.c (detect_coding_iso_2022): Initialize a local variable that might be used uninitialized. Leave a FIXME because it's not clear that this initialization is needed. --- diff --git a/src/ChangeLog b/src/ChangeLog index 07a7c1736ce..2020fa3bb11 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -56,6 +56,9 @@ (decode_coding_object, encode_coding_object, detect_coding_system): (decode_coding_emacs_mule): Mark variables that gcc -Wuninitialized does not deduce are never used uninitialized. + (detect_coding_iso_2022): Initialize a local variable that might + be used uninitialized. Leave a FIXME because it's not clear that + this initialization is needed. (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT): (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P): (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER): diff --git a/src/coding.c b/src/coding.c index 096268d1a72..9a6a4484e50 100644 --- a/src/coding.c +++ b/src/coding.c @@ -2954,7 +2954,12 @@ detect_coding_iso_2022 (struct coding_system *coding, const unsigned char *src_end = coding->source + coding->src_bytes; int multibytep = coding->src_multibyte; int single_shifting = 0; - int id; + + /* FIXME: Does ID need to be initialized here? The "End of composition" + code below does not initialize ID even though ID is used + afterwards, and perhaps that is a bug. */ + int id = 0; + int c, c1; int consumed_chars = 0; int i;