Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suppress unreferenced '_unused_op' warning
On Windows, with cl /W4, we get following warning with Python 3.12: C:\Program Files\Python312\include\cpython/unicodeobject.h(203,57): warning C4100: '_unused_op': unreferenced formal parameter Py_UNUSED hasn't changed in 5 years [1], but in Python 3.12 it started being used in unicodeobject.h [2] so it became part of the public interface. Because Py_UNUSED only prepended _unused_ to the parameter name for MSVC [1], we get the C4100 warning when compiling with /W4. In Python 3.13 this got fixed by adding a specific implementation of Py_UNUSED for MSVC [3], so the warning is unique to Python 3.12. However, as we don't know PY_VERSION_HEX _before_ including Python.h, we'll indiscriminately suppress the C4100 while including Python.h. [1] https://github.com/python/cpython/blame/3.12/Include/pymacro.h#L114-L123 [2] python/cpython@b2694ab [3] python/cpython#107249
- Loading branch information