From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16055 invoked by alias); 15 Apr 2009 18:48:17 -0000 Received: (qmail 16045 invoked by uid 22791); 15 Apr 2009 18:48:17 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_JMF_BR,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout6.012.net.il (HELO mtaout6.012.net.il) (84.95.2.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Apr 2009 18:48:11 +0000 Received: from conversion-daemon.i-mtaout6.012.net.il by i-mtaout6.012.net.il (HyperSendmail v2007.08) id <0KI500D00O2S1I00@i-mtaout6.012.net.il> for gdb-patches@sourceware.org; Wed, 15 Apr 2009 21:46:08 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.229.34.97]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KI500KB5O4UQXB0@i-mtaout6.012.net.il> for gdb-patches@sourceware.org; Wed, 15 Apr 2009 21:46:06 +0300 (IDT) Date: Wed, 15 Apr 2009 18:48:00 -0000 From: Eli Zaretskii Subject: [RFA] Fix compilation failure in parse_escape To: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83prfdlpqg.fsf@gnu.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00338.txt.bz2 Today's snapshot fails to compile: gcc -g -O2 -I. -I.././gdb -I.././gdb/common -I.././gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I.././gdb/../include/opcode -I.././gdb/../readline/.. -I../bfd -I.././gdb/../bfd -I.././gdb/../include -I../libdecnumber -I.././gdb/../libdecnumber -I.././gdb/gnulib -Ignulib -DMI_OUT=1 -DTUI=1 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Werror -c -o utils.o -MT utils.o -MMD -MP -MF .deps/utils.Tpo utils.c cc1: warnings being treated as errors utils.c: In function 'parse_escape': utils.c:1621: warning: 'target_char' may be used uninitialized in this function make[2]: *** [utils.o] Error 1 I think this happens because host_char_to_target sets its target_c argument only under certain conditions. Is the following patch the right fix? 2009-04-15 Eli Zaretskii * utils.c (parse_escape): Initialize target_char to pacify GCC. Index: gdb/utils.c =================================================================== RCS file: /cvs/src/src/gdb/utils.c,v retrieving revision 1.208 diff -u -r1.208 utils.c --- gdb/utils.c 20 Mar 2009 23:04:34 -0000 1.208 +++ gdb/utils.c 15 Apr 2009 18:45:02 -0000 @@ -1618,7 +1618,7 @@ int parse_escape (char **string_ptr) { - int target_char; + int target_char = -2; int c = *(*string_ptr)++; switch (c) {