Ticket #134 (assigned defect)

Opened 6 years ago

Last modified 6 years ago

cpdef method w/ unused buffer causes compilation error

Reported by: hoytak Owned by: dagss
Priority: major Milestone: wishlist
Component: Code Generation Keywords:
Cc:

Description

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.

Change History

Changed 6 years ago by dagss

  • owner changed from somebody to dagss
  • status changed from new to assigned
Note: See TracTickets for help on using tickets.