Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_ctypes callbacks.c uses _Py_COMP_DIAG_IGNORE_DEPR_DECLS #105732

Merged
merged 2 commits into from Jun 14, 2023

Conversation

vstinner
Copy link
Member

Replace #pragma with _Py_COMP_DIAG_PUSH,
_Py_COMP_DIAG_IGNORE_DEPR_DECLS and _Py_COMP_DIAG_POP to ease Python maintenance. Also add a comment explaining why callbacks.c ignores a deprecation warning.

Replace #pragma with _Py_COMP_DIAG_PUSH,
_Py_COMP_DIAG_IGNORE_DEPR_DECLS and _Py_COMP_DIAG_POP to ease Python
maintenance. Also add a comment explaining why callbacks.c ignores a
deprecation warning.
Copy link
Contributor

@ronaldoussoren ronaldoussoren left a comment

Choose a reason for hiding this comment

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

Patch looks good, but ...

The fallback from ffi_prep_closure_loc to ffi_prep_closure likely is only useful on macOS when using the system installation of libffi. On other platforms we know at compile time whether or not ffi_prep_closure_loc is available.

It might be possible to avoid compiling the ffi_prep_closure variant on other builds, but at first glance this will only result in even more complex preprocessor code. I can look into this in the near future, but that doesn't have to hold up this PR.

Modules/_ctypes/callbacks.c Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@vstinner
Copy link
Member Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@ronaldoussoren: please review the changes made to this pull request.

Copy link
Contributor

@ronaldoussoren ronaldoussoren left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner vstinner merged commit fb655e0 into python:main Jun 14, 2023
20 of 23 checks passed
@vstinner vstinner deleted the ctypes_ignore_depr branch June 14, 2023 10:12
@vstinner
Copy link
Member Author

Merged, thanks for the review!

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.

None yet

3 participants