GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@scoder

@scoder scoder commented Oct 20, 2017 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Without the cast, the compound literal is not accepted as a regular RHS value of an assignment.

https://bugs.python.org/issue25658

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@scoder
bpo-25658: make Py_tss_NEEDS_INIT usable in non-static initialisers
e0fb03b
Without the cast, the compound literal is not accepted as a regular RHS value of an assignment.
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Oct 20, 2017
@bedevere-bot bedevere-bot added the awaiting review label Oct 20, 2017
@scoder scoder mentioned this pull request Oct 20, 2017
Add TSS (Thread Specific Storage) API in CPython 3.7+ cython/cython#1939
Merged
ma8ma
ma8ma reviewed Oct 20, 2017
View reviewed changes
Comment thread Include/pythread.h

/* 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})

@ma8ma ma8ma Oct 20, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@scoder scoder Oct 20, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ma8ma ma8ma Oct 20, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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)

cpython/Python/pystate.c

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@scoder scoder changed the title bpo-25658: make Py_tss_NEEDS_INIT usable in non-static initialisers bpo-31828: make Py_tss_NEEDS_INIT usable in non-static initialisers Oct 20, 2017
@benjaminp
Merge branch 'master' into patch-1
5dac366
@iritkatriel

iritkatriel commented Jul 30, 2021

Copy link
Copy Markdown
Member

https://bugs.python.org/issue25658 is closed. What is the status of this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel iritkatriel closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@ma8ma ma8ma ma8ma left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@scoder @iritkatriel @ma8ma @the-knights-who-say-ni @bedevere-bot @benjaminp
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.