This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[pushed][obv] Remove constness of libdir in do_start_initialization
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: Philipp Rudo <prudo at linux dot vnet dot ibm dot com>
- Date: Thu, 23 Mar 2017 13:00:00 +0100
- Subject: [pushed][obv] Remove constness of libdir in do_start_initialization
- Authentication-results: sourceware.org; auth=none
The patch "Fix memory leak in python.c:do_start_initialization"
(https://sourceware.org/ml/gdb-patches/2017-03/msg00407.html) introduced a
compilation error on some platforms:
../../binutils-gdb/gdb/python/python.c: In function bool do_start_initialization():
../../binutils-gdb/gdb/python/python.c:1556:16: error: invalid conversion from const void* to void* [-fpermissive]
xfree (libdir);
^
This is fixed by removing the constness of libdir's data type.
gdb/ChangeLog:
* python/python.c (do_start_initialization): Remove 'const' from
data type of libdir.
---
gdb/python/python.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/python/python.c b/gdb/python/python.c
index d814252..d21e023 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1550,7 +1550,7 @@ do_start_initialization ()
/foo/bin/python
/foo/lib/pythonX.Y/...
This must be done before calling Py_Initialize. */
- const char *libdir = ldirname (python_libdir);
+ char *libdir = ldirname (python_libdir);
progname = concat (libdir, SLASH_STRING, "bin",
SLASH_STRING, "python", (char *) NULL);
xfree (libdir);
--
2.5.0