Message223501
| 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 |
|