pyLZJD icon indicating copy to clipboard operation
pyLZJD copied to clipboard

Mark compare as noexcept to avoid error

Open edmcman opened this issue 1 year ago • 5 comments

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'.

edmcman avatar Oct 11 '23 13:10 edmcman

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

EdwardRaff avatar Oct 11 '23 14:10 EdwardRaff

3.0.3

edmcman avatar Oct 11 '23 15:10 edmcman

Same for Cython 3.0.10

bobo-le avatar Jul 22 '24 17:07 bobo-le

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

EdwardRaff avatar Jul 22 '24 18:07 EdwardRaff

Yes it does! Thank you.

bobo-le avatar Jul 22 '24 20:07 bobo-le