[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

Serhiy Storchaka report at bugs.python.org
Wed Dec 16 14:08:22 EST 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I propose to change types of function parameters and local variables. In any case the constructor checks the range of parameters, so there is no problem with packing them into compact structure.

This will help to avoid errors of implicit conversion between different integer types. Also it can help to avoid code duplication in parsing integers of different size and signedness.

Adding a static assertion about the signedness of uint8_t looks meaningless to me.

----------

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


More information about the Python-bugs-list mailing list