On Dec 28, 2009, at 7:16 PM, Matthew Bromberg wrote:

>>>
>>>
>>> test.c
>>> test.c(812) : error C2143: syntax error : missing ';' before 'type'
>>> test.c(812) : error C2275: 'PyFrameObject' : illegal use of this  
>>> type
>>> as an expression
>>>        C:\python26\include\frameobject.h(47) : see declaration of
>>> 'PyFrameObject'
>>> [...]
>>> Finally I show the relevant section of test.c
>>>
>>> --------------- test.c -----------------------------
>>>
>>> /* "E:\Projects\MUD\test.pyx":19
>>> * cdef class rmat :
>>> *
>>> *     def __cinit__(self, int r, int c):             #<<<<<<<<<<<<<<
>>> *         """ Generate a real matrix of r rows and c cols
>>> unitialized. """
>>> *         cdef vsip_block_f *myb
>>> */
>>>
>>> static int __pyx_pf_4test_4rmat___cinit__(PyObject *__pyx_v_self,
>>> PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
>>> static char __pyx_doc_4test_4rmat___cinit__[] = " Generate a real
>>> matrix of r rows and c cols unitialized. ";
>>> static int __pyx_pf_4test_4rmat___cinit__(PyObject *__pyx_v_self,
>>> PyObject *__pyx_args, PyObject *__pyx_kwds) {
>>>  int __pyx_v_r;
>>>  int __pyx_v_c;
>>>  int __pyx_r;
>>>  static PyObject **__pyx_pyargnames[] =
>>> {&__pyx_n_s__r,&__pyx_n_s__c,0};
>>>  __Pyx_RefNannySetupContext("__cinit__");
>>>  __Pyx_TraceCall("__cinit__", __pyx_f[0], 19); /* This is line 812  
>>> */
>>>  if (unlikely(__pyx_kwds)) {
>>>
>>>
>>> It looks like a bug to me.

Apparently C2143 has a couple hundred meanings in MSVC I think I've  
figured out what's going on. When the refnanny is turned off ,  
__Pyx_RefNannySetupContext("__cinit__"); gets expanded to the empty  
line ; rather than a declaration, so the declarations in  
__Pyx_TraceCall come after "code" making MSVC reject them. (This is  
why all the tests run fine). I moved the declarations out--see 
http://hg.cython.org/cython-devel/rev/3e685896dd7b 
  . Try the latest cython-devel to see if that resolves your issue.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to