From 5c4481cc9bf9dfec3c35aaf5d95b08542ab8970b Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 2 Oct 2018 21:47:54 +0200 Subject: [PATCH] [gdb/python] Fix cpychecker error in pspy_solib_name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When using cpychecker, we run into: ... gdb/python/py-progspace.c: \ In function ‘PyObject* pspy_solib_name(PyObject*, PyObject*)’: gdb/python/py-progspace.c:370:25: error: Mismatching type in call to \ PyArg_ParseTuple with format code "K" [-Werror] if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc)) argument 3 ("&pc") had type "gdb_py_longest *" (pointing to 64 bits) but was expecting "long long unsigned int *" (pointing to 64 bits) for format code "K" ... Fix this fixing the type of the variable. Build and reg-tested on x86_64-linux. 2018-10-05 Tom de Vries * python/py-progspace.c (pspy_solib_name): Fix type mismatch in PyArg_ParseTuple call. --- gdb/ChangeLog | 5 +++++ gdb/python/py-progspace.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 47f879fdfe..126deb7893 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-10-05 Tom de Vries + + * python/py-progspace.c (pspy_solib_name): Fix type mismatch in + PyArg_ParseTuple call. + 2018-10-05 Tom de Vries * python/py-record-btrace.c (recpy_bt_goto): Fix type mismatch in diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c index 1e16b845e0..6395d5bb15 100644 --- a/gdb/python/py-progspace.c +++ b/gdb/python/py-progspace.c @@ -362,7 +362,7 @@ static PyObject * pspy_solib_name (PyObject *o, PyObject *args) { char *soname; - gdb_py_longest pc; + gdb_py_ulongest pc; pspace_object *self = (pspace_object *) o; PSPY_REQUIRE_VALID (self); -- 2.34.1