[Python-Dev] cffi in stdlib
solipsis at pitrou.net
Thu Feb 28 10:24:35 CET 2013
Le Thu, 28 Feb 2013 10:06:00 +0100,
Armin Rigo <arigo at tunes.org> a écrit :
> Yes, you're right, and the 32-bit Windows platform is still important.
> However, it only works on 32-bit. On typical 64-bit Posix
> environments, if you don't declare argtypes/restype, you usually end
> up very quickly with confusion between "int" and "long". And I think
> that even on 64-bit Windows, passing 0 as a NULL pointer is buggy,
> because it will pass a 32-bit 0. (It may be that it doesn't actually
> make a difference and works anyway, but I'm not sure.) Similarly, a
> function that returns a pointer (e.g. a handle on Windows) will not
> work without an explicit restype on any 64-bit platform I know of.
Indeed, argument width is quite important :-) Also, on 64-bit Windows,
long is 32-bit while size_t and pointers are 64-bit.
More information about the Python-Dev