From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21523 invoked by alias); 23 Feb 2009 01:47:44 -0000 Received: (qmail 21514 invoked by uid 22791); 23 Feb 2009 01:47:43 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from col0-omc2-s17.col0.hotmail.com (HELO col0-omc2-s17.col0.hotmail.com) (65.55.34.91) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Feb 2009 01:47:37 +0000 Received: from COL101-W19 ([65.55.34.73]) by col0-omc2-s17.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 22 Feb 2009 17:47:36 -0800 Message-ID: From: Jay To: Subject: warning/error about possibly uninitialized 'exact' in find_line_symtab Date: Mon, 23 Feb 2009 02:32:00 -0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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-02/txt/msg00427.txt.bz2 I didn't want to deal with the stdint.h issue I hit in 6.8 so I'm building 6.7.1. I see now the mail threads where it was fixed pretty simply. So maybe I'll go back to that. =20 =20 In the meantime, with 6.7.1, I hit a simple problem (so far, still compilin= g) warning variable 'exact' may be used uninitialized + -Werror. =20 =20 Here is my patch: =20 =20 -bash-3.2$ gdiff -u symtab.c.orig symtab.c --- symtab.c.orig 2009-02-22 20:25:52.000000000 -0800 +++ symtab.c 2009-02-22 19:38:25.000000000 -0800 @@ -2249,7 +2249,7 @@ struct symtab * find_line_symtab (struct symtab *symtab, int line, int *index, int *exact_m= atch ) { - int exact; + int exact =3D { 0 }; /* BEST_INDEX and BEST_LINETABLE identify the smallest linenumber> LINE so far seen. */ =20 =20 Sure, now it may be unoptimally unnecessarily initialized but I don't think that is worth worrying about. =20 =20 I use { 0 } instead of 0 because it is a more generic form that can zero initialize "anything", except some unions on some compilers, it might not always zero the entire thing. =20 =20 Current source looks about the same. =20 =20 My system is: =20 =20 -bash-3.2$ gcc32 -v Using built-in specs. Target: hppa2.0w-hp-hpux11.11 Configured with: /src/gcc-4.3.3/configure -disable-nls -disable-bootstrap -= prefi x=3D/usr/local/32 -with-as=3D/usr/local/32/bin/gas -verbose Thread model: posix gcc version 4.3.3 (GCC) =20 =20 -bash-3.2$ uname -a HP-UX unknown B.11.11 U 9000/800 1595760578 unlimited-user license =20 =20 gdb configured with: =20 $ /src/gdb-6.7.1/configure -disable-nls -prefix=3D/usr/local/32 =20 and I rm -rf /src/gdb*/intl and maybe altering PATH and/or CC, e.g. CC=3Dgcc32, but gcc first in $PATH is the same so that shouldn't matter here, by far. =20 =20 =20 Thanks, - Jay