Describe the bug
When a function point is declared with an integer return type, it seems to end up with except ?-1 return type instead. I suspect that this translation is deliberately applied to cdef functions defined in Cython, and erroneously applied to function pointers too
To Reproduce
Code to reproduce the behaviour:
cdef extern from *:
"""
int g0() {
PyErr_SetString(PyExc_RuntimeError, "Oh no!");
return 1;
}
"""
cdef int g0() except *
def test():
cdef int (*fptr)() except *
fptr = g0
fptr()
Fails to compile with the error message
fptr = g0
^
------------------------------------------------------------
fptr_cast.pyx:20:11: Cannot assign type 'int (void) except *' to 'int (*)(void) except? -1'
Expected behavior
It should compile
Environment (please complete the following information):
- OS: Linux
- Python version: 3.8.12 (but I doubt it matters)
- Cython version: current master branch
Describe the bug
When a function point is declared with an integer return type, it seems to end up with
except ?-1return type instead. I suspect that this translation is deliberately applied to cdef functions defined in Cython, and erroneously applied to function pointers tooTo Reproduce
Code to reproduce the behaviour:
Fails to compile with the error message
Expected behavior
It should compile
Environment (please complete the following information):