From 0ad58d887fe4586c873e6458ac663ee2c0ac60fa 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 21e130b5d..38696d12c 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -314,7 +314,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) {