[Cython] A bug when declare array.

Robert Bradshaw robertwb at gmail.com
Thu Aug 22 06:01:39 CEST 2013


On Sat, Aug 17, 2013 at 3:31 AM, yi huang <yi.codeplayer at gmail.com> wrote:
> I use cython 0.19.1, when compile following code:
>
> cdef void some_function():
>     cdef char buf[sizeof(long)*8/3+6]
>
> Got error message:
>
> Error compiling Cython file:
> ------------------------------------------------------------
> ...
> cdef void some_function():
>     cdef char buf[sizeof(long)*8/3+6]
>                 ^
> ------------------------------------------------------------
>
> /tmp/test.pyx:2:17: Variable type 'char []' is incomplete

That's an interesting one... it's a compile time value at C
compilation time, but not a Cython compilation time. I don't have a
quick fix.

- Robert


More information about the cython-devel mailing list