-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
Describe the bug
Cython seems to be confused by typedef function pointers when the return type is a ctypedef.
Code to reproduce the behaviour:
A declaration such as
cdef extern from "my_header.h":
ctypedef enum truth_t:
T_TRUE
T_FALSE
ctypedef truth_t ((*boolean_function)(int))
ends up with
$ cython test.pyx
Error compiling Cython file:
------------------------------------------------------------
...
cdef extern from "my_header.h":
ctypedef enum truth_t:
T_TRUE
T_FALSE
ctypedef truth_t ((*boolean_function)(int))
^
------------------------------------------------------------
test.pyx:6:23: Expected an identifier, found '*'
Error compiling Cython file:
------------------------------------------------------------
...
cdef extern from "my_header.h":
ctypedef enum truth_t:
T_TRUE
T_FALSE
ctypedef truth_t ((*boolean_function)(int))
^
------------------------------------------------------------
test.pyx:6:24: Declarator should be empty
Expected behaviour
No response
OS
linux
Python version
3.10.12
Cython version
3.0.2
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels