Closed robertwb closed 9 years ago
@Nikratio changed This is actually a regression. The problem appears with Cython 0.23.2, but not with Cython 0.21.1.
scoder changed This is new code in 0.23. It's generated in Cython/Utility/__init__.py
.
@Nikratio changed This is the problematic commit:
changeset: 10324:018118ecb0b2
user: Stefan Behnel <stefan_ml@behnel.de>
date: Fri Apr 03 15:10:45 2015 +0200
files: Cython/Utility/TypeConversion.c runtests.py tests/run/int128.pyx
description:
inline PyLong type conversion also for very large integer types and test with int128 in gcc
scoder changed Does an explicit cast fix it for you?
diff --git a/Cython/Utility/__init__.py b/Cython/Utility/__init__.py
index 40fe94b..5b27c9e 100644
--- a/Cython/Utility/__init__.py
+++ b/Cython/Utility/__init__.py
@@ -7,7 +7,7 @@ def pylong_join(count, digits_ptr='digits', join_type='unsigned long'):
(((d[<< n) | d[1](2])) << n) | d[ """
return ('(' * (count * 2) + "(%s)" % join_type + ' | '.join(
- "%s[%d](0]
))%s)" % (digits_ptr, _i, " << PyLong_SHIFT" if _i else '')
+ "(%s)%s[%d])%s)" % (join_type, digits_ptr, _i, " << PyLong_SHIFT" if _i else '')
for _i in range(count-1, -1, -1)))
scoder changed owner from somebody
to scoder
status from new
to assigned
scoder changed milestone from wishlist
to 0.23.3
resolution to fixed
status from assigned
to closed
Fixed here:
https://github.com/cython/cython/commit/3489c2211f037fd4a40be5d48459223be464f007
The Cython generated conversion functions generate a lot of warnings:
It'd be great if Cython generated C would compile without warnings.
I have attached a small testcase to reproduce the problem.
At 2015-09-11T23:17:39Z @Nikratio added attachment testcase.tgz
Migrated from http://trac.cython.org/ticket/865