From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 716 invoked by alias); 9 Dec 2009 07:56:41 -0000 Received: (qmail 705 invoked by uid 22791); 9 Dec 2009 07:56:40 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f183.google.com (HELO mail-px0-f183.google.com) (209.85.216.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Dec 2009 07:56:35 +0000 Received: by pxi13 with SMTP id 13so3527051pxi.24 for ; Tue, 08 Dec 2009 23:56:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.154.33 with SMTP id g33mr1103871wfo.300.1260345394080; Tue, 08 Dec 2009 23:56:34 -0800 (PST) In-Reply-To: <4B1F5744.6090209@redhat.com> References: <4B1929DC.7070809@redhat.com> <4B1A25B0.1090903@redhat.com> <4B1E5F1C.4030202@redhat.com> <4B1F5744.6090209@redhat.com> From: Hui Zhu Date: Wed, 09 Dec 2009 07:56:00 -0000 Message-ID: Subject: Re: [python][patch] And range method to type To: Phil Muldoon Cc: gdb-patches ml , Tom Tromey , Eli Zaretskii Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00127.txt.bz2 It's OK now. Thanks. My gcc is: gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=3Dc,c++,fortran,objc,obj-c++,treelang --prefix=3D/usr --enable-shared --with-system-zlib --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --enable-nls --with-gxx-include-dir=3D/usr/include/c++/4.2 --program-suffix=3D-4.2 --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=3Dall --enable-checking=3Drelease --build=3Di486-linux-gnu --host=3Di486-linux-gnu --target=3Di486-linux-gnu Thread model: posix gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4) Hui On Wed, Dec 9, 2009 at 15:52, Phil Muldoon wrote: > 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. =A0I do not see them on my compiler, but it looks like > some versions might trigger the (bogus, imo ;) warning: > > > -- > > Index: python/py-type.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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 =A0 =A08 Dec 2009 14:06:02 -0000 =A0 =A0 =A0 1.4 > +++ python/py-type.c =A0 =A09 Dec 2009 07:47:34 -0000 > @@ -282,7 +282,8 @@ > =A0 struct type *type =3D ((type_object *) self)->type; > =A0 PyObject *result; > =A0 PyObject *low_bound =3D NULL, *high_bound =3D NULL; > - =A0LONGEST low, high; > + =A0/* Initialize these to appease GCC warnings. =A0*/ > + =A0LONGEST low =3D 0, high =3D 0; >