[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

Petr Viktorin report at bugs.python.org
Tue Mar 17 11:17:53 EDT 2020


Petr Viktorin <encukou at gmail.com> added the comment:

> You are the one who wanted to *introduce* a hack by dereferencing
as char and then cast to _Bool. :-)

Yes, I did change my mind after reading the documentation.

The docs say two contradicting things:
1. The '?' conversion code corresponds to the _Bool type defined by C99
2. ... any non-zero value will be True when unpacking.

So it's clear that something has to change. IMO, preserving (2) and relaxing (1) is the more useful choice.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39689>
_______________________________________


More information about the Python-bugs-list mailing list