ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ctypes-users
ctypes-users
Re: [ctypes-users] Problems with 64 signed integer
by Thomas Heller other posts by this author
Nov 24 2006 9:36AM messages near this date
[ctypes-users] Problems with 64 signed integer | [ctypes-users] Anyone with a working gccxml on Win32 want to give me a hand?
David Cournapeau schrieb:
>  Hi,
>  
>      I recently developed small wrappers around some C libraries, which 
>  worked find under python2.4 + ctypes 1.0.1, but failed with python 2.5.
>      After investigation, the problem is that for some reason, 
>  c_longlong, which was 8 bytes under python2.4, is 4 under python2.5. 
>  Also, importing c_int64 fails (not found error) under python2.5 (I 
>  replaced c_longlong with c_int64 since, the latter being a much easier 
>  to find error). All this with the dapper ubuntu package.
>      The error is seemed to be because ubuntu python2.5 packages use a 
>  packaged libffi4 instead of the libffi furnished by ctypes, and as such, 
>  python2.5 is configured with the option --with-system-ffi.

I can reproduce this bug :-(.

>      My questions are:
>         - is this intended for c_longlong to be only 4 bytes in some 
>  cases ? (in ISO C99, my understanding was that long long was guaranteed 
>  to be at least 8 bytes)

Of course not.  c_longlong should have the same size as the struct module's
'q' specifier.

>         - is the lack of c_int64 of bug of ctypes, libffi, both ?
>         - I try to understand where the problem lies, but I don't have 
>  much knowledge on python C Api, so I am a bit lost in the code of ctypes

I've seen that you already answered that yourself in the bug you
submitted to ubuntu - looks like a libffi bug.

I will add some testcases to ctypes so that this problem will at
least be seen in the ctypes unittests.

Thanks,
Thomas


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users
Thread:
David Cournapeau
Thomas Heller

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved