From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32192 invoked by alias); 9 Dec 2009 07:52:47 -0000 Received: (qmail 32179 invoked by uid 22791); 9 Dec 2009 07:52:46 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Dec 2009 07:52:42 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB97qcOl012110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Dec 2009 02:52:38 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB97qavm003271; Wed, 9 Dec 2009 02:52:36 -0500 Message-ID: <4B1F5744.6090209@redhat.com> Date: Wed, 09 Dec 2009 07:52:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: Hui Zhu CC: gdb-patches ml , Tom Tromey , Eli Zaretskii Subject: Re: [python][patch] And range method to type References: <4B1929DC.7070809@redhat.com> <4B1A25B0.1090903@redhat.com> <4B1E5F1C.4030202@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-12/txt/msg00126.txt.bz2 On 12/09/2009 03:00 AM, Hui Zhu wrote: > cc1: warnings being treated as errors > ../../src/gdb/python/py-type.c: In function 'typy_range': > ../../src/gdb/python/py-type.c:285: warning: 'high' may be used > uninitialized in this function > ../../src/gdb/python/py-type.c:285: warning: 'low' may be used > uninitialized in this function > make[2]: *** [py-type.o] Error 1 > make[2]: Leaving directory `/home/teawater/gdb/cvs/bgdb/gdb' > make[1]: *** [all-gdb] Error 2 > make[1]: Leaving directory `/home/teawater/gdb/cvs/bgdb' > make: *** [all] Error 2 I've checked in the following patch under the obvious rule to appease these warnings. I do not see them on my compiler, but it looks like some versions might trigger the (bogus, imo ;) warning: -- Index: python/py-type.c =================================================================== RCS file: /cvs/src/src/gdb/python/py-type.c,v retrieving revision 1.4 diff -u -r1.4 py-type.c --- python/py-type.c 8 Dec 2009 14:06:02 -0000 1.4 +++ python/py-type.c 9 Dec 2009 07:47:34 -0000 @@ -282,7 +282,8 @@ struct type *type = ((type_object *) self)->type; PyObject *result; PyObject *low_bound = NULL, *high_bound = NULL; - LONGEST low, high; + /* Initialize these to appease GCC warnings. */ + LONGEST low = 0, high = 0;