gh-98724: Fix type punning issue in Py_SETREF() by vstinner · Pull Request #99739 · python/cpython · GitHub
Skip to content

gh-98724: Fix type punning issue in Py_SETREF() - #99739

Closed
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:setref_typeof
Closed

vstinner wants to merge 1 commit into
python:mainfrom
vstinner:setref_typeof

Conversation

@vstinner

@vstinner vstinner commented Nov 23, 2022

Copy link
Copy Markdown
Member

Fix type punning issue in Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros. Don't cast pointers to avoid type punning which cause miscompilation of functions using these macros.

Fix type punning issue in Py_CLEAR(), Py_SETREF() and Py_XSETREF()
macros. Don't cast pointers to avoid type punning which cause
miscompilation of functions using these macros.
@vstinner

Copy link
Copy Markdown
Member Author

@vstinner

Copy link
Copy Markdown
Member Author

Ah, building Python with the PR fails on Windows (MSVC) with:

warning C4013: '__typeof__' undefined

@vstinner

Copy link
Copy Markdown
Member Author

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.

2 participants