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.

Author ronaldoussoren
Recipients mark.dickinson, ned.deily, ronaldoussoren, wayedt
Date 2014-07-20.07:06:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <74677678-E10C-429C-A754-1C9E03E12AED@mac.com>
In-reply-to <1405804965.98.0.492983260943.issue22012@psf.upfronthosting.co.za>
Content
> On 19 jul. 2014, at 23:22, Mark Dickinson <report@bugs.python.org> wrote:
> 
> 
> Mark Dickinson added the comment:
> 
> The relevant piece of code in the struct module looks like this:
> 
> static PyObject *
> nu_bool(const char *p, const formatdef *f)
> {
>    BOOL_TYPE x;
>    memcpy((char *)&x, p, sizeof x);
>    return PyBool_FromLong(x != 0);
> }
> 
> Is it possible that BOOL_TYPE is a bitfield of length 1, and that clang is somehow making use of that fact?

I haven't found a definitive source yet, but it seems that the only valid values for _Bool, which BOOL_TYPE expands to, are 0 and 1.  Clang might make use of that restriction. 

Ronald
History
Date User Action Args
2014-07-20 07:06:21ronaldoussorensetrecipients: + ronaldoussoren, mark.dickinson, ned.deily, wayedt
2014-07-20 07:06:21ronaldoussorenlinkissue22012 messages
2014-07-20 07:06:21ronaldoussorencreate