[python][patch] And range method to type

Hui Zhu teawater@gmail.com
Wed Dec 9 07:56:00 GMT 2009


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=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-targets=all --enable-checking=release
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-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 <pmuldoon@redhat.com> 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.  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;
>



More information about the Gdb-patches mailing list