[Numpy-discussion] fwrite() failure in PyArray_ToFile

David Warde-Farley dwf@cs.toronto....
Sat Sep 5 19:40:15 CDT 2009

On 4-Sep-09, at 11:59 PM, Charles R Harris wrote:

> The size of long depends on the compiler as well as the operating  
> system. On linux x86_64, IIRC, it is 64 bits, on Windows64 I believe  
> it is 32. Ints always seem to be 32 bits. But something funny is  
> definitely going on. It shouldn't be possible to allocate an array  
> bigger than npy_intp, which is a signed number, and the casts to  
> size_t and such should be safe. But in anycase, using long in the  
> print statement is not portable and needs fixing.

I got him to run a check on that machine and you're correct,  
sizeof(long) == 8.


More information about the NumPy-Discussion mailing list