GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-31828: make Py_tss_NEEDS_INIT usable in non-static initialisers by scoder · Pull Request #4060 · python/cpython Conversation
|
|
|
||
| /* 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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
FYI, we've solved an initialization issue of a TSS key by using temporary variables. #1362 (comment)
Lines 49 to 54 in 731e189
| /* A TSS key must be initialized with Py_tss_NEEDS_INIT | |
| in accordance with the specification. */ | |
| { | |
| Py_tss_t initial = Py_tss_NEEDS_INIT; | |
| runtime->gilstate.autoTSSkey = initial; | |
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
https://bugs.python.org/issue25658 is closed. What is the status of this PR? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.