[issue22012] struct.unpack('?', '\x02') returns (False,) on Mac OSX

Ronald Oussoren report at bugs.python.org
Sun Jul 20 16:46:01 CEST 2014


Ronald Oussoren added the comment:

> On 20 jul. 2014, at 10:32, Mark Dickinson <report at bugs.python.org> wrote:
> 
> 
> Mark Dickinson added the comment:
> 
>> In practice, I doubt that Python's going to meet such platforms in a hurry.
> 
> Hrm; looks like that's not a particularly safe assumption, especially with older compilers that might do a "typedef int _Bool"

I'm not sure about the actual definition, but at least for OSX on PPC sizeof(bool) is not 1. I ran into this with pyobjc when I tried to treat BOOL and bool the same.

All of this is with Objective-C, but the same should be true for plain C.

----------
title: struct.unpack('?', '\x02') returns (False,) when Python is built with clang -> struct.unpack('?', '\x02') returns (False,) on Mac OSX

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22012>
_______________________________________


More information about the Python-bugs-list mailing list