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 shreyanavigyan
Recipients paul.moore, shreyanavigyan, steve.dower, tim.golden, zach.ware
Date 2021-05-07.07:43:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org>
In-reply-to
Content
I usually program in Python C API without defining Py_LIMITED_API. I thought about using the stable ABI today. To my surprise, there are lot of conflicts occurring if Py_LIMITED_API is defined. The whole list of errors are:-

1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(16,17): error C2037: left of 'tp_free' specifies undefined struct/union '_typeobject'
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(23,31): error C2037: left of 'tp_alloc' specifies undefined struct/union '_typeobject'
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(46,34): warning C4013: '_PyArg_ParseTupleAndKeywords_SizeT' undefined; assuming extern returning int
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(97,21): error C2079: 'ExampleType' uses undefined struct '_typeobject'
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(109,1): error C2078: too many initializers
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(99,3): error C2224: left of '.tp_name' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(100,3): error C2224: left of '.tp_doc' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(101,3): error C2224: left of '.tp_basicsize' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(102,3): error C2224: left of '.tp_itemsize' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(103,3): error C2224: left of '.tp_flags' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(104,3): error C2224: left of '.tp_new' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(105,3): error C2224: left of '.tp_init' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(106,3): error C2224: left of '.tp_dealloc' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(107,3): error C2224: left of '.tp_members' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension.h(108,3): error C2224: left of '.tp_methods' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(16,20): error C2037: left of 'tp_free' specifies undefined struct/union '_typeobject'
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(23,33): error C2037: left of 'tp_alloc' specifies undefined struct/union '_typeobject'
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(147,21): error C2079: 'CustomType' uses undefined struct '_typeobject'
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(160,1): error C2078: too many initializers
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(149,6): error C2224: left of '.tp_name' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(150,6): error C2224: left of '.tp_doc' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(151,6): error C2224: left of '.tp_basicsize' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(152,6): error C2224: left of '.tp_itemsize' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(153,6): error C2224: left of '.tp_flags' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(154,6): error C2224: left of '.tp_new' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(155,6): error C2224: left of '.tp_init' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(156,6): error C2224: left of '.tp_dealloc' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(157,6): error C2224: left of '.tp_members' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(158,6): error C2224: left of '.tp_methods' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\Extension2.h(159,6): error C2224: left of '.tp_getset' must have struct/union type
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\main.c(18,32): warning C4133: 'function': incompatible types - from 'int *' to 'PyTypeObject *'
1>C:\Users\shrey\source\repos\PyTypeExtension\Extension\main.c(19,28): warning C4133: 'function': incompatible types - from 'int *' to 'PyTypeObject *'

This is pretty awkward because these errors only occur in stable ABI. Am I doing something wrong here or is there a bug out there?
History
Date User Action Args
2021-05-07 07:43:08shreyanavigyansetrecipients: + shreyanavigyan, paul.moore, tim.golden, zach.ware, steve.dower
2021-05-07 07:43:08shreyanavigyansetmessageid: <1620373388.58.0.836474503961.issue44066@roundup.psfhosted.org>
2021-05-07 07:43:08shreyanavigyanlinkissue44066 messages
2021-05-07 07:43:08shreyanavigyancreate