Skip to content

pythoncapi_compat: don't define Py_NULL if it is already defined - #18699

Merged
hauntsaninja merged 1 commit into
python:masterfrom
mr-c:gcc_15_py3.12
Feb 17, 2025
Merged

pythoncapi_compat: don't define Py_NULL if it is already defined#18699
hauntsaninja merged 1 commit into
python:masterfrom
mr-c:gcc_15_py3.12

Conversation

@mr-c

@mr-c mr-c commented Feb 17, 2025

Copy link
Copy Markdown
Contributor

Fixes: #18698

This is a naive fix for the gcc 15 error when compiling for Python 3.12

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@hauntsaninja
hauntsaninja merged commit 0808624 into python:master Feb 17, 2025
@mr-c
mr-c deleted the gcc_15_py3.12 branch February 18, 2025 00:01
@cdce8p

cdce8p commented Feb 18, 2025

Copy link
Copy Markdown
Collaborator

Thanks @mr-c! pythoncapi_compat.h is usually just a copy from https://github.com/python/pythoncapi-compat. It would be awesome if you could do the fix upstream as well.

/CC @vstinner

@vstinner

Copy link
Copy Markdown
Member

Thanks @mr-c! pythoncapi_compat.h is usually just a copy from https://github.com/python/pythoncapi-compat. It would be awesome if you could do the fix upstream as well.

I fixed the issue upstream: python/pythoncapi-compat#138.

I'm surprised that nobody reported the issue earlier. I didn't notice that the macro is redefined.

@cdce8p

cdce8p commented Feb 18, 2025

Copy link
Copy Markdown
Collaborator

I fixed the issue upstream: python/pythoncapi-compat#138.

Thanks @vstinner!

x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
…hon#18699)

Fixes: python#18698 

This is a naive fix for the gcc 15 error when compiling for Python 3.12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation failure with GCC 15 + Python 3.12: mypyc/lib-rt/pythoncapi_compat.h:41:11: error: ‘_Py_NULL’ redefined [-Werror]

4 participants