Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Stefan Behnel
David Vierra schrieb am 03.07.2015 um 02:26: > I see that Cython doesn't actually know the > underlying types of typedefs because it doesn't parse any C headers. And even if it did parse header files, it still wouldn't know the properties of the underlying types because they are platform specific

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread David Vierra
Very informative discussion. I see that Cython doesn't actually know the underlying types of typedefs because it doesn't parse any C headers. Cython doesn't even care about the exact length of the underlying type, just that it can order the types by rank to find which of two types is widest. Wh

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Ian Henriksen
On Thu, Jul 2, 2015 at 9:50 PM Robert Bradshaw wrote: > To clarify, any choice of int64_t + unsigned long will be wrong on one > platform or the others, but getting the wrong sign seems preferable to > getting the wrong number of bits. > That makes sens. Thanks for looking at it! -Ian Henriksen

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Robert Bradshaw
To clarify, any choice of int64_t + unsigned long will be wrong on one platform or the others, but getting the wrong sign seems preferable to getting the wrong number of bits. On Thu, Jul 2, 2015 at 8:45 PM, Robert Bradshaw wrote: > I've fixed this particular case by making our integer ranking mo

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Robert Bradshaw
I've fixed this particular case by making our integer ranking more consistent: signedness is ignored for anything but chars and typedefs are always preferred (as a last tiebreaker) over non-typedefs (rather than arbitrarily picking the first or second argument). https://github.com/cython/cython/com

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Ian Henriksen
On Thu, Jul 2, 2015 at 1:08 PM Robert McGibbon wrote: > Right, okay. I think I understand. > > -Robert > > On Thu, Jul 2, 2015 at 12:58 AM, Stefan Behnel > wrote: > >> Robert McGibbon schrieb am 02.07.2015 um 09:49: >> >> "libc.stdint.int64_t" is hand-wavingly declared as "long" >> > >> > There

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Robert McGibbon
Right, okay. I think I understand. -Robert On Thu, Jul 2, 2015 at 12:58 AM, Stefan Behnel wrote: > Robert McGibbon schrieb am 02.07.2015 um 09:49: > >> "libc.stdint.int64_t" is hand-wavingly declared as "long" > > > > There are some deeper issues in the rest of your message, but as a > > prelim

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Stefan Behnel
Robert McGibbon schrieb am 02.07.2015 um 09:49: >> "libc.stdint.int64_t" is hand-wavingly declared as "long" > > There are some deeper issues in the rest of your message, but as a > preliminary matter, isn't this a clear error for linux-32 and windows? No, it's not. That's just what Cython sees.

Re: [Cython] Use of long type for intermediate integral variables

2015-07-02 Thread Robert McGibbon
> "libc.stdint.int64_t" is hand-wavingly declared as "long" There are some deeper issues in the rest of your message, but as a preliminary matter, isn't this a clear error for linux-32 and windows? -Robert On Wed, Jul 1, 2015 at 11:30 PM, Stefan Behnel wrote: > Robert McGibbon schrieb am 01.0

Re: [Cython] Use of long type for intermediate integral variables

2015-07-01 Thread Stefan Behnel
Robert McGibbon schrieb am 01.07.2015 um 11:12: > I noticed an issue on Windows when debugging an issue in scipy > , but I think it might be a > little more general. In some places in the generated code, it looks like > intermediate integral variables ar