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 scoder
Recipients masamoto, ncoghlan, scoder
Date 2017-10-20.16:07:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508515676.46.0.213398074469.issue31828@psf.upfronthosting.co.za>
In-reply-to
Content
Following up on issue 25658, it was found that the current definition of Py_tss_NEEDS_INIT restricts its use to initialisers in C and cannot be used for arbitrary assignments. It is currently declared as follows:

    #define Py_tss_NEEDS_INIT   {0}

which results in a C compiler error for assignments like "x = Py_tss_NEEDS_INIT".

I proposed to change this to

    #define Py_tss_NEEDS_INIT   ((Py_tss_t) {0})

in compliance with GCC and C99, but that fails to compile in MSVC and probably other old C++-ish compilers.

I'm not sure how to improve this declaration, but given that it's a public header file, restricting its applicability seems really unfortunate.
History
Date User Action Args
2017-10-20 16:07:56scodersetrecipients: + scoder, ncoghlan, masamoto
2017-10-20 16:07:56scodersetmessageid: <1508515676.46.0.213398074469.issue31828@psf.upfronthosting.co.za>
2017-10-20 16:07:56scoderlinkissue31828 messages
2017-10-20 16:07:56scodercreate