PYLONG_BITS_IN_DIGIT is misconfigured on g++

Bug #1545899 reported by methane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python
Fix Released
Unknown
python2.7 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

gcc and g++ interprets pyport.h in different way.

```
(system) inada-n@oldbench:~$ cat longbits.c
#include <Python.h>
#include <longintrepr.h>

int main() {
        printf("digit bits = %d\n", PYLONG_BITS_IN_DIGIT);
        printf("sizeof(digit) = %lu\n", sizeof(digit));
}
(system) inada-n@oldbench:~$ gcc longbits.c -I /usr/include/python2.7/
(system) inada-n@oldbench:~$ ./a.out
digit bits = 30
sizeof(digit) = 4
(system) inada-n@oldbench:~$ g++ longbits.c -I /usr/include/python2.7/
(system) inada-n@oldbench:~$ ./a.out
digit bits = 15
sizeof(digit) = 2
```

This breaks some extension modules. For example, see https://github.com/msgpack/msgpack-python/issues/169

Please backport this bugfix.
https://github.com/python/cpython/commit/050ba5ec1e941e05607ef29049bde08798387bcc

Revision history for this message
Matthias Klose (doko) wrote :

according to the upstream issue this is fixed since 2012.

Changed in python2.7 (Ubuntu):
status: New → Triaged
status: Triaged → Fix Released
Changed in python:
status: Unknown → Fix Released
Revision history for this message
methane (songofacandy) wrote :

@doko
Do you mean this is resolved in Ubuntu 12.04 LTS ?

Ubuntu 12.04 is used widely.
And this bug may break user data silently.
I really hope this bug is fixed in 12.04.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.