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

cpdef method w/ unused buffer causes compilation error #694

Closed
robertwb opened this issue Nov 25, 2008 · 2 comments
Closed

cpdef method w/ unused buffer causes compilation error #694

robertwb opened this issue Nov 25, 2008 · 2 comments

Comments

@robertwb
Copy link
Contributor

Hello,

The following code segment won't compile:

from numpy cimport ndarray

cdef class DumbClass:
    cpdef dumb_function(self):
        cdef ndarray[int] nothing
        return None

When I try to compile it, it returns

gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -g -fwrapv -fPIC -I/home/hoytak/sysroot/lib/python2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c cs/test_cpdef.c -o build/temp.linux-i686-2.5/cs/test_cpdef.o -O3 -mtune=core2 -march=core2
cs/test_cpdef.c: In function ‘__pyx_f_2cs_10test_cpdef_9DumbClass_dumb_function’:
cs/test_cpdef.c:408: warning: implicit declaration of function ‘__Pyx_SafeReleaseBuffer’
cs/test_cpdef.c:408: error: ‘__pyx_bstruct_nothing’ undeclared (first use in this function)
cs/test_cpdef.c:408: error: (Each undeclared identifier is reported only once
cs/test_cpdef.c:408: error: for each function it appears in.)
error: command 'gcc' failed with exit status 1

A quick search shows that __pyx_bstruct_nothing is not declared anywhere.

Also, it seems to happen only in class methods and only when cpdef is used (not cdef or def).

I'm using changeset 1374.

Migrated from http://trac.cython.org/ticket/134

@robertwb
Copy link
Contributor Author

@dagss changed owner from somebody to dagss
status from new to assigned
commented

@da-woods
Copy link
Contributor

This seems to work on the current master.

@da-woods da-woods modified the milestones: wishlist, 3.0 Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants