You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
By inspecting the generated .c/.cpp file, I found an intermediate variable of type char * is created to hold the return value of type const char *, causing compiler warnings (or errors with stricter compiler warning checks like -Werror).
and the reason is __pyx_t_1 is declared as char *, not const char *, so in a production environment with more sophisticated build system, it's turned to an error:
cupy/core/dlpack.cpp:4298:32: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
__pyx_t_4 = PyCapsule_GetName(__pyx_v_dltensor); if (unlikely(__pyx_t_4 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
error: command 'gcc' failed with exit status 1
making any functions returning const char * not usable in Cython.
It should just work by respecting the constness if declared in a cdef variable. Currently I don't even know how to work around it after scratching my head for a long time, which is rare to me...
Environment (please complete the following information):
Python version 3.7.8
Cython version 0.29.21
The text was updated successfully, but these errors were encountered: