[Cython] Potential 32bit linux issue
Robert Bradshaw
robertwb at gmail.com
Sun Jan 6 04:26:38 CET 2013
You ned to declare INT64_MIN as a long long. Enums are of type int.
On Jan 5, 2013 5:17 PM, "Dieter Vandenbussche" <dieterv77 at gmail.com> wrote:
> Hi, this is my first time posting to this list, hopefully i'm not wasting
> anyone's time.
>
> i believe i may have encountered an issue on 32bit linux using cython.
>
> Here's a small example pyx file that illustrates the potential issue:
>
> #Begin pyx file
> cdef extern from "stdint.h":
> enum: INT64_MIN
>
> cpdef f():
> cdef long long x = INT64_MIN
> print x
> print INT64_MIN
> #End pyx file
>
> The first print statement works as expected, the second does not (and
> prints "0"). Looking at the C code that was generated, it looks like
> the second print statement is resulting in a call to PyInt_FromLong, which
> I believe might be the source of an overflow.
>
> Thanks for taking the time to take a look.
>
> dieter
>
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20130105/65f25943/attachment.html>
More information about the cython-devel
mailing list