Make GDB build with python 2.4 again.

Pedro Alves pedro@codesourcery.com
Sun Oct 19 20:18:00 GMT 2008


gcc -g -O2   -I. -I../../head/gdb -I../../head/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../head/gdb/../include/opcode -I../../head/gdb/../readline/.. -I../bfd -I../../head/gdb/../bfd -I../../head/gdb/../include -I../libdecnumber -I../../head/gdb/../libdecnumber  -I../../head/gdb/gnulib -Ignulib  -DMI_OUT=1  -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-unused -Wno-switch -Wno-char-subscripts -Werror -c -o python-value.o -MT python-value.o -MMD -MP -MF .deps/python-value.Tpo -fno-strict-aliasing -DNDEBUG -fwrapv ../../head/gdb/python/python-value.c
../../head/gdb/python/python-value.c:100: warning: initialization from incompatible pointer type
make: *** [python-value.o] Error 1

/usr/include/python2.4/object.h

 typedef int (*inquiry)(PyObject *);

 typedef struct {
	inquiry mp_length;
	binaryfunc mp_subscript;
	objobjargproc mp_ass_subscript;
 } PyMappingMethods;

/usr/include/python2.5/object.h

 typedef Py_ssize_t (*lenfunc)(PyObject *);

 typedef struct {
	lenfunc mp_length;
	binaryfunc mp_subscript;
	objobjargproc mp_ass_subscript;
 } PyMappingMethods;

I'm checking in the attached fix.  I get 95 expected passes with
both 2.4 and 2.5.

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python.diff
Type: text/x-diff
Size: 5947 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20081019/cad35bd2/attachment.bin>


More information about the Gdb-patches mailing list