[gdb/python] Fix cpychecker error in pspy_solib_name
authorTom de Vries <tdevries@suse.de>
Tue, 2 Oct 2018 19:47:54 +0000 (21:47 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 4 Oct 2018 22:20:08 +0000 (00:20 +0200)
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  <tdevries@suse.de>

* python/py-progspace.c (pspy_solib_name): Fix type mismatch in
PyArg_ParseTuple call.

gdb/ChangeLog
gdb/python/py-progspace.c

index 47f879fdfedf44d64fc05fac3b1256024b3219c2..126deb7893c665d93e67caace34135d1e2d4266d 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-05  Tom de Vries  <tdevries@suse.de>
+
+       * python/py-progspace.c (pspy_solib_name): Fix type mismatch in
+       PyArg_ParseTuple call.
+
 2018-10-05  Tom de Vries  <tdevries@suse.de>
 
        * python/py-record-btrace.c (recpy_bt_goto): Fix type mismatch in
index 1e16b845e0a5f461ffc696e76b8c94daa2c4a113..6395d5bb155c20befa44c254f2453b8dab8c4584 100644 (file)
@@ -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);
This page took 0.031509 seconds and 4 git commands to generate.