Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure when using typed memoryviews in module containing a cdef class called "array" #2030

Open
dominicelse opened this issue Nov 30, 2017 · 0 comments

Comments

@dominicelse
Copy link

With Cython 0.27.3 and GCC 5.4.0, cythonizing the following code

cdef class array:
    pass

class Bar(object):
    def do_something(self):
        cdef int [:] view

leads to the error messages

/home/dom/temp/test/viewtest.c:1002:49: warning: ‘struct __pyx_array_obj’ declared inside parameter list
 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
                                                 ^
/home/dom/temp/test/viewtest.c:1002:49: warning: its scope is only this definition or declaration, which is probably not what you want
/home/dom/temp/test/viewtest.c:1372:49: warning: ‘struct __pyx_array_obj’ declared inside parameter list
 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self);
                                                 ^
/home/dom/temp/test/viewtest.c:1372:18: error: conflicting types for ‘__pyx_array_get_memview’
 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self);
                  ^
/home/dom/temp/test/viewtest.c:1002:18: note: previous declaration of ‘__pyx_array_get_memview’ was here
 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
                  ^
/home/dom/temp/test/viewtest.c: In function ‘__pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__’:
/home/dom/temp/test/viewtest.c:1839:15: error: dereferencing pointer to incomplete type ‘struct __pyx_array_obj’
   __pyx_v_self->ndim = ((int)__pyx_t_1);
               ^
/home/dom/temp/test/viewtest.c: At top level:
/home/dom/temp/test/viewtest.c:2909:18: error: conflicting types for ‘__pyx_array_get_memview’
 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) 
                  ^
/home/dom/temp/test/viewtest.c:1372:18: note: previous declaration of ‘__pyx_array_get_memview’ was here
 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self);
                  ^
/home/dom/temp/test/viewtest.c: In function ‘__pyx_array_new’:
/home/dom/temp/test/viewtest.c:3223:50: error: ‘__pyx_array_type’ undeclared (first use in this function)
     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, 
                                                  ^
/home/dom/temp/test/viewtest.c:3223:50: note: each undeclared identifier is reported only once for each function it appears in
/home/dom/temp/test/viewtest.c: In function ‘initviewtest’:
/home/dom/temp/test/viewtest.c:14441:22: error: ‘__pyx_array_type’ undeclared (first use in this function)
   if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_
                      ^
/home/dom/temp/test/viewtest.c: At top level:
/home/dom/temp/test/viewtest.c:1692:12: warning: ‘__pyx_array___cinit__’ defined but not used [-Wunused-function]
 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, 
            ^
/home/dom/temp/test/viewtest.c:2720:13: warning: ‘__pyx_array___dealloc__’ defined but not used [-Wunused-function]
 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
             ^
/home/dom/temp/test/viewtest.c:2851:18: warning: ‘__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__’ defined but not used [-Wunused-function]
 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObje
                  ^
/home/dom/temp/test/viewtest.c:2909:18: warning: ‘__pyx_array_get_memview’ defined but not used [-Wunused-function]
 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) 
                  ^
/home/dom/temp/test/viewtest.c:2988:18: warning: ‘__pyx_array___getattr__’ defined but not used [-Wunused-function]
 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__py
                  ^
/home/dom/temp/test/viewtest.c:3053:18: warning: ‘__pyx_array___getitem__’ defined but not used [-Wunused-function]
 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__py
                  ^
/home/dom/temp/test/viewtest.c:3118:12: warning: ‘__pyx_array___setitem__’ defined but not used [-Wunused-function]
 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant