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

Code will never be executed warning in for-loop #3172

jakirkham opened this issue Oct 8, 2019 · 0 comments


Copy link

commented Oct 8, 2019

The following code generates a warning for me using Cython 0.29.13 and Python 3.7.3.

def my_for():
    cdef Py_ssize_t i
    cdef int[4] arr
    cdef int[::1] arr_mv = <int[:4:1]>(&arr[0])
    for i in range(4):
        arr_mv[i] = 0
      code will never be executed [-Wunreachable-code]
                module = PyImport_ImportModuleLevelObject(
1 warning generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.