Issue 26179: Python C-API "unused-parameter" warnings (original) (raw)

Issue26179

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/70367

classification

Title: Python C-API "unused-parameter" warnings
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.6

process

Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Devyn Johnson, vstinner
Priority: normal Keywords:

Created on 2016-01-22 14:06 by Devyn Johnson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4341 merged petr.viktorin,2017-11-08 15:51
Messages (5)
msg258809 - (view) Author: Devyn Johnson (Devyn Johnson) Date: 2016-01-22 14:06
When compiling Python C-API extensions with "-Wextra", warnings like warning: unused parameter ‘self’ [-Wunused-parameter] appear for code (like below). It seems like a minor issue for a warning to appear when "PyObject *self, PyObject *args" is required. Is there an underlying issue in the API? static PyObject *mathfunc_ismersenneprime(PyObject *self, PyObject *args) { sllint num; ASSERT_LONGLONG_ARG(num); if (num < (sllint)0) ERR_POSITIVE_INT; returnbool(islonglongmersenneprime(num)); }
msg258810 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-01-22 14:13
> Is there an underlying issue in the API? You can use self if your code. If you don't need it, you can use Py_UNUSED() macro available since Python 3.4.
msg258811 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-01-22 14:14
Please don't open bug reports to ask questions on your own code. The bug tracker is not forum.
msg258813 - (view) Author: Devyn Johnson (Devyn Johnson) Date: 2016-01-22 14:46
Thank you and sorry.
msg305865 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-08 15:59
New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr Viktorin) in branch 'master': bpo-29179: Document the Py_UNUSED macro (#4341) https://github.com/python/cpython/commit/2138163621196a186975796afb2b0a6aa335231d
History
Date User Action Args
2022-04-11 14:58:26 admin set github: 70367
2017-11-08 15:59:23 vstinner set messages: +
2017-11-08 15:51:37 petr.viktorin set pull_requests: + <pull%5Frequest4297>
2016-01-22 14:46:51 Devyn Johnson set messages: +
2016-01-22 14:14:15 vstinner set status: open -> closedresolution: not a bugmessages: +
2016-01-22 14:13:41 vstinner set nosy: + vstinnermessages: +
2016-01-22 14:06:20 Devyn Johnson create