patch to fix error message buglet
by Tom Tromey
I got this:
../../archer/gdb/python/py-inferior.c:439:37: error: Mismatching type in call to PyArg_ParseTupleAndKeywords with format code "Os#|O" [-fpermissive]
argument 7 ("&buf_len") had type "int *" (pointing to 32 bits)
but was expecting "Py_ssize_t *" for format code "c#"
The error refers to "c#" but the format actually contains "s#".
I think the appended is needed.
Tom
diff --git a/libcpychecker/PyArg_ParseTuple.py b/libcpychecker/PyArg_ParseTuple.py
index 2eff8e1..a7dba7b 100644
--- a/libcpychecker/PyArg_ParseTuple.py
+++ b/libcpychecker/PyArg_ParseTuple.py
@@ -211,15 +211,15 @@ class PyArgParseFmt:
elif c in ['s', 'z']: # string, possibly NULL/None
if next == '#':
- result.add_argument('c#',
+ result.add_argument('s#',
[get_const_char_ptr().pointer,
get_hash_size_type().pointer])
i += 1
elif next == '*':
- result.add_argument('c*', [get_Py_buffer().pointer])
+ result.add_argument('s*', [get_Py_buffer().pointer])
i += 1
else:
- result.add_argument('c', [get_const_char_ptr().pointer])
+ result.add_argument('s', [get_const_char_ptr().pointer])
# FIXME: seeing lots of (const char**) versus (char**) mismatches here
# do we care?
12 years, 11 months
buglet in python checker
by Tom Tromey
I got this error:
../../archer/gdb/python/py-block.c: In function ‘gdbpy_block_for_pc’:
../../archer/gdb/python/py-block.c:306:25: error: Mismatching type in call to PyArg_ParseTuple with format code "K" [-fpermissive]
argument 3 ("&pc") had type "gdb_py_ulongest *" (pointing to 64 bits)
but was expecting "long long unsigned int *" (pointing to 64 bits) for format code "K"
But gdb_py_ulongest is a typedef:
typedef unsigned PY_LONG_LONG gdb_py_ulongest;
I didn't immediately see the problem looking at PyArg_ParseTuple.py.
Tom
12 years, 11 months
testing
by David Malcolm
(testing again)
12 years, 11 months
testing
by David Malcolm
(Just testing)
12 years, 11 months