Skip to content

Minor: fix unicode-related inline function warnings #93011

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

Merged
merged 1 commit into from
May 23, 2022

Conversation

wjakob
Copy link
Contributor

@wjakob wjakob commented May 20, 2022

When compiling my extension module against latest main version of CPython, I get many warnings related to unused parameters in unicodeobject.h. Example:

In file included from /Users/wjakob/nanobind/src/tensor.cpp:1:
In file included from /Users/wjakob/nanobind/include/nanobind/tensor.h:14:
In file included from /Users/wjakob/nanobind/include/nanobind/nanobind.h:37:
In file included from /Users/wjakob/nanobind/include/nanobind/nb_python.h:22:
In file included from /Users/wjakob/cpython-dist/include/python3.12/Python.h:51:
In file included from /Users/wjakob/cpython-dist/include/python3.12/unicodeobject.h:1029:
/Users/wjakob/cpython-dist/include/python3.12/cpython/unicodeobject.h:196:57: warning: unused parameter 'op' [-Wunused-parameter]
static inline unsigned int PyUnicode_IS_READY(PyObject *op) {
                                                        ^
/Users/wjakob/cpython-dist/include/python3.12/cpython/unicodeobject.h:416:45: warning: unused parameter 'op' [-Wunused-parameter]
static inline int PyUnicode_READY(PyObject *op)
                                            ^

This PR fixes those warnings. This isn't really a bug in Python, so I did not create a corresponding issue tracker ticket.

@ghost
Copy link

ghost commented May 20, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@wjakob
Copy link
Contributor Author

wjakob commented May 20, 2022

@bedevere-bot (This issue seems too minor to warrant an issue number or a NEWS entry)

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! cc @vstinner who worked on this file recently.

I think we can skip the news entry here because the problem it fixes hasn't been in any release (it's in the main branch only). If it had been in a release, we should have added a NEWS entry because it's a user-visible change.

I'll leave this open for a few days in case Victor or others have comments, and then merge.

@vstinner
Copy link
Member

Thanks for your contribution! cc @vstinner who worked on this file recently.

cc @methane who introduced the warning.

@wjakob wjakob force-pushed the unicode-warning branch from 723bde1 to 2e58f1b Compare May 23, 2022 11:33
@wjakob
Copy link
Contributor Author

wjakob commented May 23, 2022

(Commit amended with tweaked syntax)

Copy link
Member

@vstinner vstinner 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 b2694ab into python:main May 23, 2022
@vstinner
Copy link
Member

Merged, thanks.

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