Skip to content

Implement Py_UNUSED() for Windows MSVC compiler #107249

Closed
@vstinner

Description

@vstinner

The Py_UNUSED() is not implemented for the Windows MSVC compiler.

Example with this function included by Python.h: see #107239 (comment)

static inline unsigned int
PyUnicode_IS_READY(PyObject* Py_UNUSED(op))
{ return 1; }

Without my change, building a C program with cl /W4 which just includes Python.h emits the warning:

Include\cpython/unicodeobject.h(199): warning C4100: '_unused_op': unreferenced formal parameter

With my change, no warnings are emitted!

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions