Message369481
See for example the following C program:
```
#define Py_LIMITED_API
#include "Python.h"
int main() {
Py_Initialize();
PyObject* foo;
PyIter_Check(foo);
}
```
when compiled (gcc test.c `pkg-config --cflags python3`) produces:
```
In file included from /usr/include/python3.6m/Python.h:135:0,
from test.c:3:
test.c: In function ‘main’:
/usr/include/python3.6m/abstract.h:712:20: error: dereferencing pointer to incomplete type ‘struct _typeobject’
((obj)->ob_type->tp_iternext != NULL && \
^
test.c:8:3: note: in expansion of macro ‘PyIter_Check’
PyIter_Check(foo);
^~~~~~~~~~~~
/usr/include/python3.6m/abstract.h:713:38: error: ‘_PyObject_NextNotImplemented’ undeclared (first use in this function); did you mean ‘PyObject_HashNotImplemented’?
(obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
^
test.c:8:3: note: in expansion of macro ‘PyIter_Check’
PyIter_Check(foo);
^~~~~~~~~~~~
/usr/include/python3.6m/abstract.h:713:38: note: each undeclared identifier is reported only once for each function it appears in
(obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
^
test.c:8:3: note: in expansion of macro ‘PyIter_Check’
PyIter_Check(foo);
^~~~~~~~~~~~
``` |
|
Date |
User |
Action |
Args |
2020-05-20 22:13:33 | tekknolagi | set | recipients:
+ tekknolagi |
2020-05-20 22:13:33 | tekknolagi | set | messageid: <1590012813.24.0.664283108192.issue40704@roundup.psfhosted.org> |
2020-05-20 22:13:33 | tekknolagi | link | issue40704 messages |
2020-05-20 22:13:33 | tekknolagi | create | |
|