This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tekknolagi
Recipients tekknolagi
Date 2020-05-20.22:13:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590012813.24.0.664283108192.issue40704@roundup.psfhosted.org>
In-reply-to
Content
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);
   ^~~~~~~~~~~~
```
History
Date User Action Args
2020-05-20 22:13:33tekknolagisetrecipients: + tekknolagi
2020-05-20 22:13:33tekknolagisetmessageid: <1590012813.24.0.664283108192.issue40704@roundup.psfhosted.org>
2020-05-20 22:13:33tekknolagilinkissue40704 messages
2020-05-20 22:13:33tekknolagicreate