[Numpy-discussion] fwrite() failure in PyArray_ToFile
Fri Sep 4 23:29:36 CDT 2009
Charles R Harris skrev:
> 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.
If I remember the C standard correctly, a long is guaranteed to be at
least 32 bits, whereas an int is guaranteed to be at least 16 bits. A
short is at least 16 bits and a long long is 64 bits. Then there is
intptr_t which is wide enough to store a pointer, but could be wider. A
size_t usually has the size of a pointer but not always (on segment and
offset architectures they might differ). Considering PEP353, should we
be indexing with Py_ssize_t instead of npy_intp? I believe (correct me
if I'm wrong) npy_intp is typedef'ed to Py_intptr_t.
More information about the NumPy-Discussion