[Cython] 'local variable referenced before assignment' warnings

robert.rex at exasol.com robert.rex at exasol.com
Wed Sep 21 09:32:53 CEST 2011


I got a (misleading) Cython warning from the following code example:

cdef extern from "<bar.h>":
     void foo(int &a, int &b)

cdef cyfoo():
     cdef int cya, cyb
     foo(cya, cyb)

Executing "cython --cplus" produced these messages:
warning: example.pyx:6:11: local variable 'cya' referenced before assignment
warning: example.pyx:6:16: local variable 'cyb' referenced before assignment

This started with Cython 0.15 (and 0.15.1 also issues these warnings).
I assume this warning shouldn't be produced (as in a similar issue
here: http://trac.cython.org/cython_trac/ticket/714), right?!


More information about the cython-devel mailing list