[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2017-11-08 Thread STINNER Victor
STINNER Victor added the comment: New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr Viktorin) in branch 'master': bpo-29179: Document the Py_UNUSED macro (#4341)

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2017-11-08 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +4296 ___ Python tracker ___ ___

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2014-01-09 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- assignee: - larry resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19976

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2014-01-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset c4ababa110a2 by Larry Hastings in branch 'default': Issue #19976: Argument Clinic METH_NOARGS functions now always http://hg.python.org/cpython/rev/c4ababa110a2 -- nosy: +python-dev ___ Python tracker

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-16 Thread STINNER Victor
STINNER Victor added the comment: The Visual Studio pragma disables for the rest of the file, which is undesirable. Maybe we could turn it on and off inline, but it's not clear to me that that would have the desired effect of turning off the warning for explicitly that parameter

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-15 Thread Larry Hastings
Larry Hastings added the comment: Here's a first attempt at a patch. The Visual Studio pragma disables for the rest of the file, which is undesirable. Maybe we could turn it on and off inline, but it's not clear to me that that would have the desired effect of turning off the warning for

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
New submission from Stefan Krah: I was just reading the _pickle sources and it appears that AC does not generate a second arg for METH_NOARGS functions: #define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF\ {clear, (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS,

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: I prefer to omit the unused parameter, even if NULL *is* passed to the function. If you prefer to add the unused parameter, what do you propose to avoid compiler warnings if unused parameters are checked? -- nosy: +haypo

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: Stefan is right. I'll fix Clinic. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19976 ___ ___

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: STINNER Victor rep...@bugs.python.org wrote: If you prefer to add the unused parameter, what do you propose to avoid compiler warnings if unused parameters are checked? This works quite portably in _decimal (I don't get warnings from gcc, icc, suncc, Visual

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: A quick google suggests: http://sourcefrog.net/weblog/software/languages/C/unused.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19976 ___

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: To do it properly with Clang requires a pragma: http://stackoverflow.com/questions/3417837/what-is-the-best-way-to-supress-unused-variable-x-warning/18724213#18724213 What a mess. -- ___ Python tracker

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread STINNER Victor
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

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: Stefan Krah rep...@bugs.python.org wrote: The macro I posted really works on all obscure buildbot platforms. N.B. clang also defines __GNUC__, as does the intel compiler. -- ___ Python tracker rep...@bugs.python.org

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: Larry Hastings rep...@bugs.python.org wrote: To do it properly with Clang requires a pragma: Hmm. I just tested and clang warns with -Wall -W, but does not warn if __attribute__((unused)) is present. The macro I posted really works on all obscure buildbot

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: STINNER Victor rep...@bugs.python.org wrote: I would prefer Py_UNUSED name. This sounds like a nice addition to Include/pymacros.h. Yes, Py_UNUSED is nicer. -- ___ Python tracker rep...@bugs.python.org