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

Mark compare as noexcept to avoid error #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edmcman
Copy link

@edmcman edmcman commented Oct 11, 2023

Without this patch, I get the following error:

Error compiling Cython file:
------------------------------------------------------------
...
@cython.wraparound(False)   # Deactivate negative indexing.
@cython.initializedcheck(False)
@cython.cdivision(True)
@cython.exceptval(check=False)
cdef void sort(signed int* y, ssize_t l) noexcept:
    qsort(y, l, cython.sizeof(int), compare)
                                    ^
------------------------------------------------------------

/home/eschwartz/.local/lib/python3.6/site-packages/pyLZJD/lzjd_cython.pyx:434:36: Cannot assign type 'int (const_void *, const_void *) except? -1' to 'int (*)(const_void *, const_void *) noexcept'. Exception values are incompatible. Suggest adding 'noexcept' to type 'int (const_void *, const_void *) except? -1'.

@EdwardRaff
Copy link
Owner

What version of Cython were you using? I want to do some quick checks before accepting it.

@edmcman
Copy link
Author

edmcman commented Oct 11, 2023

3.0.3

@bobo-le
Copy link

bobo-le commented Jul 22, 2024

Same for Cython 3.0.10

@EdwardRaff
Copy link
Owner

I apparently forgot about this. @bobo-le does edmcman's patch fix your issue?

@bobo-le
Copy link

bobo-le commented Jul 22, 2024

Yes it does! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants