]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45476: Add _Py_RVALUE() macro (GH-29860)
authorVictor Stinner <vstinner@python.org>
Tue, 30 Nov 2021 11:14:45 +0000 (12:14 +0100)
committerGitHub <noreply@github.com>
Tue, 30 Nov 2021 11:14:45 +0000 (12:14 +0100)
commitc19c3a09618ac400538ee412f84be4c1196c7bab
tree538842c2c053a4f62123ad5244b77aef64ec14c6
parentf97ec09baf8431494fd2ef5133090c7b0afd0551
bpo-45476: Add _Py_RVALUE() macro (GH-29860)

Add a new _Py_RVALUE() macro to prevent using an expression as an
l-value.

Replace a "(void)" cast with the _Py_RVALUE() macro in the following
macros:

* PyCell_SET()
* PyList_SET_ITEM()
* PyTuple_SET_ITEM()
* _PyGCHead_SET_FINALIZED()
* _PyGCHead_SET_NEXT()
* asdl_seq_SET()
* asdl_seq_SET_UNTYPED()

Add also parentheses around macro arguments in PyCell_SET() and
PyTuple_SET_ITEM() macros.
Include/cpython/cellobject.h
Include/cpython/listobject.h
Include/cpython/tupleobject.h
Include/internal/pycore_asdl.h
Include/internal/pycore_gc.h
Include/pymacro.h