[issue19976] Argument Clinic: generate second arg for METH_NOARGS

STINNER Victor report at bugs.python.org
Fri Dec 13 17:11:42 CET 2013


STINNER Victor added the comment:

> We could call the macro PY_UNUSED or something.

I would prefer Py_UNUSED name. This sounds like a nice addition to Include/pymacros.h.

In C++, you can omit the parameter name, so the macro should take the parameter name: Py_UNUSED(name). Example:

   int foo(int Py_UNUSED(bar)) { return 1 }

In Visual Studio, you can use:

#define Py_UNUSED(NAME) __pragma(warning(suppress:4100)) NAME

For Clang, you can try:

#define Py_UNUSED(NAME) _Pragma(diagnostic ignored "-Wunused") NAME

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19976>
_______________________________________


More information about the Python-bugs-list mailing list