Cleanup: ignore GCC cast-function-type warning for PyMethodDef's

While these warnings point to real errors in the code,
PyMethodDef are an exception where functions with different numbers
of arguments are all cast to the same function type.
This commit is contained in:
Campbell Barton
2023-07-21 13:42:35 +10:00
parent 1153e9f69c
commit 0777c1861e
26 changed files with 316 additions and 14 deletions

View File

@@ -3271,6 +3271,11 @@ static PyGetSetDef Matrix_getseters[] = {
/** \name Matrix Type: Method Definitions
* \{ */
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
static PyMethodDef Matrix_methods[] = {
/* Derived values. */
{"determinant", (PyCFunction)Matrix_determinant, METH_NOARGS, Matrix_determinant_doc},
@@ -3334,6 +3339,10 @@ static PyMethodDef Matrix_methods[] = {
{nullptr, nullptr, 0, nullptr},
};
#if (defined(__GNUC__) && !defined(__clang__))
# pragma GCC diagnostic pop
#endif
/** \} */
/* -------------------------------------------------------------------- */