From baf6b99004bc61aee73bf199bb28669fd2f3a7cf Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 24 Jun 2018 15:38:09 +0200 Subject: [PATCH] Silence GCC8's -Wcast-function-type. (#1396) * Silence GCC8's -Wcast-function-type. See https://bugs.python.org/issue33012 and PRs linked therein. --- include/pybind11/pybind11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 504e0a9bc..cba219c0d 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -306,7 +306,7 @@ protected: rec->def = new PyMethodDef(); std::memset(rec->def, 0, sizeof(PyMethodDef)); rec->def->ml_name = rec->name; - rec->def->ml_meth = reinterpret_cast(*dispatcher); + rec->def->ml_meth = reinterpret_cast(reinterpret_cast(*dispatcher)); rec->def->ml_flags = METH_VARARGS | METH_KEYWORDS; capsule rec_capsule(rec, [](void *ptr) {