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 p-ganssle
Recipients p-ganssle, serhiy.storchaka
Date 2020-12-16.16:38:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608136700.72.0.309400744061.issue42660@roundup.psfhosted.org>
In-reply-to
Content
As I mentioned, it's a style issue. Yes this did not introduce any user-observable bugs, nor should it have changed the machine code emitted by the assembly on any competent compiler.

The issue is that I had deliberately chosen to do a "redundant" check to improve the readability and to be robust against someone saying, "Why is this a unit8_t instead of an int? I don't think it makes anything faster..." or some other justification for changing all the uint8_t fields to ints.

Previous to this, we had something where the compiler would fix any bugs caused by that by itself by emitting an additional bounds check. In my proposed fix to the compiler warnings, there was a static assertion where the machine would alert us if the situation changed. The problem is that we now have a non-machine-checked comment for something that would be difficult to issue tests for.

Frankly, I think that even the worst case scenario here isn't that bad — TZif files malformed in a very specific way would be accepted as valid. As it's coded now, this would probably just lead to a crash later, or possibly some weird results in time zone math. Still, I think we need a solution to this problem because our blind adherence to an invalid compiler warning is leading us to write more fragile code, whic h is especially problematic in C, which is notoriously dangerous and problematic to write.
History
Date User Action Args
2020-12-16 16:38:20p-gansslesetrecipients: + p-ganssle, serhiy.storchaka
2020-12-16 16:38:20p-gansslesetmessageid: <1608136700.72.0.309400744061.issue42660@roundup.psfhosted.org>
2020-12-16 16:38:20p-gansslelinkissue42660 messages
2020-12-16 16:38:20p-gansslecreate