Python 2.4 compile failure (Re: [PATCH 24/28] introduce gdb_pymodule_addobject)

Tom Tromey tromey@redhat.com
Mon Jun 3 16:06:00 GMT 2013


Ulrich> Now I guess 2.4 is quite old, but it is still supported according to
Ulrich> GDB documentation (and there are some special cases in the sources) ...

Ulrich> Should this be fixed?

Yes.  Can you please try the appended?

Tom

diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c
index 7c7c5ca..bbbdef4 100644
--- a/gdb/python/py-utils.c
+++ b/gdb/python/py-utils.c
@@ -436,7 +436,8 @@ gdb_pymodule_addobject (PyObject *module, const char *name, PyObject *object)
   int result;
 
   Py_INCREF (object);
-  result = PyModule_AddObject (module, name, object);
+  /* Python 2.4 did not have a 'const' here.  */
+  result = PyModule_AddObject (module, (char *) name, object);
   if (result < 0)
     Py_DECREF (object);
   return result;



More information about the Gdb-patches mailing list