This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: const fix in py-type.c
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: gcc-python-plugin <gcc-python-plugin at lists dot fedorahosted dot org>
- Date: Thu, 13 Oct 2011 07:53:15 -0600
- Subject: FYI: const fix in py-type.c
I'm checking this in.
David Malcolm's GCC plugin found a bug in py-type.c -- we were using
PyArg_ParseTuple's "s" format but passing in a char*, not a const char*.
The fix is appended.
Thanks again to David for this plugin.
Tom
2011-10-13 Tom Tromey <tromey@redhat.com>
* python/py-type.c (typy_has_key): Make 'field' const.
Index: python/py-type.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-type.c,v
retrieving revision 1.24
diff -u -r1.24 py-type.c
--- python/py-type.c 9 Oct 2011 19:21:38 -0000 1.24
+++ python/py-type.c 13 Oct 2011 13:48:41 -0000
@@ -1176,7 +1176,7 @@
typy_has_key (PyObject *self, PyObject *args)
{
struct type *type = ((type_object *) self)->type;
- char *field;
+ const char *field;
int i;
if (!PyArg_ParseTuple (args, "s", &field))