I want to write an extension type with a method that takes a typed-memory-view as one of its arguments. MWE:
main.pyx
# cython: language_level = 3
cdef class main:
cdef void foo(self, double [:] x):
pass
setup.py
from setuptools import setup
from Cython.Build import cythonize
if __name__ == "__main__":
setup(ext_modules=cythonize("main.pyx"))
When I run the code (the real one) everything seems to work fine, but I get the following compilation warning:
running build_ext
building 'main' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c main.c -o build/temp.macosx-12-x86_64-cpython-310/main.o
main.c:19220:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
CYTHON_FALLTHROUGH;
^
main.c:353:34: note: expanded from macro 'CYTHON_FALLTHROUGH'
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
^
main.c:19231:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
CYTHON_FALLTHROUGH;
^
main.c:353:34: note: expanded from macro 'CYTHON_FALLTHROUGH'
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
^
2 warnings generated.
clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk build/temp.macosx-12-x86_64-cpython-310/main.o -o build/lib.macosx-12-x86_64-cpython-310/main.cpython-310-darwin.so
ld: warning: -undefined dynamic_lookup may not work with chained fixups
copying build/lib.macosx-12-x86_64-cpython-310/main.cpython-310-darwin.so ->
I don't know what it means, but it only happens when the extension type has a method that takes a typed-memory-view as an argument.
Should I do anything about it?