This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Wrong size of c_ulong in linux, windows version is fine
Type: behavior Stage: resolved
Components: ctypes Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Jorge Cisneros, eryksun
Priority: normal Keywords:

Created on 2017-03-08 21:08 by Jorge Cisneros, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg289257 - (view) Author: Jorge Cisneros (Jorge Cisneros) Date: 2017-03-08 21:08
In the linux version 2.7.12 the size of c_ulong and c_ulonglong is the same, that is not correct 

Python 2.7.12 (default, Mar  6 2017, 18:06:04)
[GCC 4.9.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> print sizeof(c_ulong),sizeof(c_ulonglong)
8 8


Doing the same in Windows, the results are correct.

Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> print sizeof(c_ulong),sizeof(c_ulonglong)
4 8
>>>
msg289259 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2017-03-08 21:19
ctypes is correct. 64-bit Linux uses an LP64 data model, and 64-bit Windows uses LLP64.

https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models
History
Date User Action Args
2022-04-11 14:58:44adminsetgithub: 73947
2017-03-08 21:19:38eryksunsetstatus: open -> closed

nosy: + eryksun
messages: + msg289259

resolution: not a bug
stage: resolved
2017-03-08 21:08:17Jorge Cisneroscreate