robert.rex | 21 Sep 09:32 2011

[Cython] 'local variable referenced before assignment' warnings

Hi,

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?!

Thanks,
Robert

Gmane