summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2017-11-08 15:59:20 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-11-08 15:59:20 (GMT)
commit2138163621196a186975796afb2b0a6aa335231d (patch)
treed010135c9b733521558be615045afc96e40007b9 /Doc
parent0de92859caf25e65fc968d4bb68626e9ba21b851 (diff)
downloadcpython-2138163621196a186975796afb2b0a6aa335231d.zip
cpython-2138163621196a186975796afb2b0a6aa335231d.tar.gz
cpython-2138163621196a186975796afb2b0a6aa335231d.tar.bz2
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.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/intro.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst
index 6323180..1500610 100644
--- a/Doc/c-api/intro.rst
+++ b/Doc/c-api/intro.rst
@@ -149,6 +149,13 @@ complete listing.
Like ``getenv(s)``, but returns *NULL* if :option:`-E` was passed on the
command line (i.e. if ``Py_IgnoreEnvironmentFlag`` is set).
+.. c:macro:: Py_UNUSED(arg)
+
+ Use this for unused arguments in a function definition to silence compiler
+ warnings, e.g. ``PyObject* func(PyObject *Py_UNUSED(ignored))``.
+
+ .. versionadded:: 3.4
+
.. _api-objects: