Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 31, 2022

Replace "(PyCFunction)(void(*)(void))func" cast with
_PyCFunction_CAST(func).

https://bugs.python.org/issue47164

@arhadthedev
Copy link
Member

What to do with yet unmerged PRs that add Argument Clinic stuff (like #32010)? They'll introduce more (PyCFunction)(void(*)(void)).

@vstinner
Copy link
Member Author

You should ignore this draft PR for now. I'm still thinking about it :-) If there will be a conflict, I will simply regenerate this PR (rerun make clinic).

Replace "(PyCFunction)(void(*)(void))func" cast with
_PyCFunction_CAST(func).
@vstinner vstinner marked this pull request as ready for review May 3, 2022 17:53
@vstinner
Copy link
Member Author

vstinner commented May 3, 2022

I rebased my PR.

@vstinner
Copy link
Member Author

vstinner commented May 3, 2022

Example of change:

-    {"test_object_converter", (PyCFunction)(void(*)(void))test_object_converter, METH_FASTCALL, test_object_converter__doc__},
+    {"test_object_converter", _PyCFunction_CAST(test_object_converter), METH_FASTCALL, test_object_converter__doc__},

@vstinner vstinner merged commit b270b82 into python:main May 3, 2022
@vstinner vstinner deleted the clinic_cfunc_cast branch May 3, 2022 18:25
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.

5 participants