Closed eli-schwartz closed 4 months ago
Thanks for reporting. First, I want to recreate this error to find the right way to fix it, so can you provide your GCC, cython (not python), and thriftpy2 versions?
$ gcc --version
gcc (Gentoo 13.2.1_p20240113-r1 p12) 13.2.1 20240113
$ cython --version
Cython version 3.0.8
I attempted to compile thriftpy2 0.4.20 (the latest tag, no significant changes since then).
Here's a full build log in case it helps: build.log
For a bit of additional context, this was discovered while trying to build thriftpy2 with LTO. In gentoo, we are using the following flags to uncover very likely runtime bugs with LTO (but strict-aliasing violations can cause issues even without LTO):
CFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
LDFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
Here is some generated code in cybin.pyx -> cybin.c:
and
Attempting to compile thriftpy2 produces the following compiler errors:
I suspect there are easier ways to bitfiddle a double.