summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh.poyarekar@gmail.com>2018-04-29 18:59:33 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-04-29 18:59:33 (GMT)
commit55edd0c185ad2d895b5d73e47d67049bc156b654 (patch)
treed609dfc924b59b89816a610ba86cd3e6c34a641c /Modules/selectmodule.c
parent9f3535c9cde8813ce631d6ebe4d790682f594828 (diff)
downloadcpython-55edd0c185ad2d895b5d73e47d67049bc156b654.zip
cpython-55edd0c185ad2d895b5d73e47d67049bc156b654.tar.gz
cpython-55edd0c185ad2d895b5d73e47d67049bc156b654.tar.bz2
bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030)
METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index fe2968a..a366d1b 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -1006,7 +1006,7 @@ devpoll_internal_close(devpollObject *self)
}
static PyObject*
-devpoll_close(devpollObject *self)
+devpoll_close(devpollObject *self, PyObject *Py_UNUSED(ignored))
{
errno = devpoll_internal_close(self);
if (errno < 0) {
@@ -1032,7 +1032,7 @@ devpoll_get_closed(devpollObject *self)
}
static PyObject*
-devpoll_fileno(devpollObject *self)
+devpoll_fileno(devpollObject *self, PyObject *Py_UNUSED(ignored))
{
if (self->fd_devpoll < 0)
return devpoll_err_closed();
@@ -1327,7 +1327,7 @@ pyepoll_dealloc(pyEpoll_Object *self)
}
static PyObject*
-pyepoll_close(pyEpoll_Object *self)
+pyepoll_close(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
{
errno = pyepoll_internal_close(self);
if (errno < 0) {
@@ -1353,7 +1353,7 @@ pyepoll_get_closed(pyEpoll_Object *self)
}
static PyObject*
-pyepoll_fileno(pyEpoll_Object *self)
+pyepoll_fileno(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
{
if (self->epfd < 0)
return pyepoll_err_closed();
@@ -2053,7 +2053,7 @@ kqueue_queue_dealloc(kqueue_queue_Object *self)
}
static PyObject*
-kqueue_queue_close(kqueue_queue_Object *self)
+kqueue_queue_close(kqueue_queue_Object *self, PyObject *Py_UNUSED(ignored))
{
errno = kqueue_queue_internal_close(self);
if (errno < 0) {
@@ -2079,7 +2079,7 @@ kqueue_queue_get_closed(kqueue_queue_Object *self)
}
static PyObject*
-kqueue_queue_fileno(kqueue_queue_Object *self)
+kqueue_queue_fileno(kqueue_queue_Object *self, PyObject *Py_UNUSED(ignored))
{
if (self->kqfd < 0)
return kqueue_queue_err_closed();