This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Python 2.4 compile failure (Re: [PATCH 24/28] introduce gdb_pymodule_addobject)
- From: Tom Tromey <tromey at redhat dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 03 Jun 2013 10:06:10 -0600
- Subject: Re: Python 2.4 compile failure (Re: [PATCH 24/28] introduce gdb_pymodule_addobject)
- References: <8761ziy43f dot fsf at fleche dot redhat dot com> <201306031249 dot r53Cnp4I018753 at d06av02 dot portsmouth dot uk dot ibm dot com>
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;