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 mark.dickinson
Recipients mark.dickinson, ned.deily, ronaldoussoren, wayedt
Date 2014-07-19.21:22:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405804965.98.0.492983260943.issue22012@psf.upfronthosting.co.za>
In-reply-to
Content
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?

One thing I don't understand is that this shouldn't affect *standard* packing and unpacking (as opposed to native), but I still see the problem for a format of "<????".  However, it's fine for ">????".  Some debugging shows that we're calling 'nu_bool' even for "<????", which is a bit odd.
History
Date User Action Args
2014-07-19 21:22:46mark.dickinsonsetrecipients: + mark.dickinson, ronaldoussoren, ned.deily, wayedt
2014-07-19 21:22:45mark.dickinsonsetmessageid: <1405804965.98.0.492983260943.issue22012@psf.upfronthosting.co.za>
2014-07-19 21:22:45mark.dickinsonlinkissue22012 messages
2014-07-19 21:22:45mark.dickinsoncreate