Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2138163

Browse files
encukouvstinner
authored andcommitted
bpo-29179: Document the Py_UNUSED macro (#4341)
Py_UNUSED has a public name, and is used in the wild outside CPython, but was not documented. Rectify that. The macro was added in bpo-19976 and referenced in bpo-26179.
1 parent 0de9285 commit 2138163

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/c-api/intro.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ complete listing.
149149
Like ``getenv(s)``, but returns *NULL* if :option:`-E` was passed on the
150150
command line (i.e. if ``Py_IgnoreEnvironmentFlag`` is set).
151151

152+
.. c:macro:: Py_UNUSED(arg)
153+
154+
Use this for unused arguments in a function definition to silence compiler
155+
warnings, e.g. ``PyObject* func(PyObject *Py_UNUSED(ignored))``.
156+
157+
.. versionadded:: 3.4
158+
152159

153160
.. _api-objects:
154161

0 commit comments

Comments
 (0)