Skip to content

Commit

Permalink
fix a compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
st-pasha committed Nov 28, 2023
1 parent 1757944 commit 4a3020c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/python/ext_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ class ExtModule {
}

void add(PyCFunctionWithKeywords F, PKArgs& args) {
// According to Python docs, the second parameter can be a function of different
// types, whose interpretation will depend on the [ml_flags].
// (https://docs.python.org/3/c-api/structures.html#c.PyMethodDef)
DISABLE_CLANG_WARNING("-Wcast-function-type")
methods.push_back(PyMethodDef {
args.get_short_name(),
reinterpret_cast<PyCFunction>(F),
METH_VARARGS | METH_KEYWORDS,
args.get_docstring()
});
RESTORE_CLANG_WARNING("-Wcast-function-type")
}

private:
Expand Down

0 comments on commit 4a3020c

Please sign in to comment.