bpo-31828: make Py_tss_NEEDS_INIT usable in non-static initialisers#4060
bpo-31828: make Py_tss_NEEDS_INIT usable in non-static initialisers#4060scoder wants to merge 2 commits intopython:mainfrom
Conversation
Without the cast, the compound literal is not accepted as a regular RHS value of an assignment.
|
|
||
| /* When static allocation, you must initialize with Py_tss_NEEDS_INIT. */ | ||
| #define Py_tss_NEEDS_INIT {0} | ||
| #define Py_tss_NEEDS_INIT ((Py_tss_t) {0}) |
There was a problem hiding this comment.
Sadly, the compound literals is not compatible with C++ standard 😣 (it's a C99 feature)
A similar issue of the C-API header was pointed out at related #1362 (comment).
There was a problem hiding this comment.
Ok, then ... should we just distinguish the C and C++ cases? And maybe even MSVC from the real compilers, as usual?
I mean, this is a public header file. It's fairly annoying if it constrains the applicability of its definitions. I guess I'll have to open a new ticket for this one after all...
There was a problem hiding this comment.
FYI, we've solved an initialization issue of a TSS key by using temporary variables. #1362 (comment)
Lines 49 to 54 in 731e189
|
https://bugs.python.org/issue25658 is closed. What is the status of this PR? |
Without the cast, the compound literal is not accepted as a regular RHS value of an assignment.
https://bugs.python.org/issue25658