Skip to content

gh-92800: Fix C++ _Py_CAST with constant types - #92818

Closed
da-woods wants to merge 3 commits into
python:mainfrom
da-woods:cpp_cast_92800
Closed

da-woods wants to merge 3 commits into
python:mainfrom
da-woods:cpp_cast_92800

Conversation

@da-woods

Copy link
Copy Markdown
Contributor

Thus fixing PyUnicode_READ in C++.
Fixes #92800

I've created a C++ helper struct definition to work out the
type with constant added (it's OK to add const to a constant
type in typedefs in C++).

Thus fixing PyUnicode_READ in C++.
Fixes python#92800

I've created a C++ helper struct definition to work out the
type with constant added (it's OK to add const to a constant
type in typedefs in C++).
@da-woods

da-woods commented May 15, 2022 •

Copy link
Copy Markdown
Contributor Author

I think this can be skipped in news.

I don't think it's hugely easy to add tests for this specifically - I think this requires Python to be tested with a C++ compiler (which I don't know if it is right now?) I've added a test now

I'm not hugely happy with adding a helper struct definition, but I can't see any other easy way to do this.

@da-woods

Copy link
Copy Markdown
Contributor Author

This was fixed elsewhere

@da-woods da-woods closed this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyUnicode_READ() fails to build on C++: _Py_CAST() used with a constant type (const void*)

2 participants