Ralnoc / pam-python

pam_python is a PAM module that runs the Python interpreter, and so allows PAM modules to be written in Python.
https://sourceforge.net/p/pam-python/code/ci/default/tree/
22 stars 10 forks source link

fix build with -Wcast-function-type -Werror on gcc8 #4

Open anarcat opened 5 years ago

anarcat commented 5 years ago

New versions of gcc8 will fail to build from source on Python declarations because of the hairy cast we're doing there, example:

pam_python.c:1355:19: error: cast between incompatible function types from 'PyObject * (*)(PyObject *, PyObject *, PyObject *)' {aka 'struct _object * (*)(struct _object *, struct _object *, struct _object *)'} to 'PyObject * (*)(PyObject *, PyObject *)' {aka 'struct _object * (*)(struct _object *, struct _object *)'} [-Werror=cast-function-type]

This fix comes form the upstream cpython implementation:

https://github.com/python/cpython/commit/62be74290aca26d16f3f55ece7ff6dad14e60e8d#diff-c3cf251f16d5a03a9e7d4639f2d6f998