Message369523
Here's the warning given by clang:
/Users/remi/src/cpython/Modules/_zoneinfo.c:1487:9: warning: variable 'dst_offset' is used uninitialized whenever 'if'
condition is true [-Wsometimes-uninitialized]
if (*p == '\0') {
^~~~~~~~~~
/Users/remi/src/cpython/Modules/_zoneinfo.c:1544:50: note: uninitialized use occurs here
build_tzrule(std_abbr, dst_abbr, std_offset, dst_offset, start, end, out);
^~~~~~~~~~
/Users/remi/src/cpython/Modules/_zoneinfo.c:1487:5: note: remove the 'if' if its condition is always false
if (*p == '\0') {
^~~~~~~~~~~~~~~~~
/Users/remi/src/cpython/Modules/_zoneinfo.c:1460:32: note: initialize the variable 'dst_offset' to silence this warning
long std_offset, dst_offset;
^
= 0
/Users/remi/src/cpython/Modules/_zoneinfo.c:1910:19: warning: suggest braces around initialization of subobject
[-Wmissing-braces]
_tzrule rv = {0};
^
{}
Looking at the code path, the unitialized dst_offset may create a ZoneInfo with a garbage value in dstoff with some inputs so this should be backported to Python3.9 too. |
|
Date |
User |
Action |
Args |
2020-05-21 13:47:59 | remi.lapeyre | set | recipients:
+ remi.lapeyre |
2020-05-21 13:47:59 | remi.lapeyre | set | messageid: <1590068879.49.0.231802096396.issue40713@roundup.psfhosted.org> |
2020-05-21 13:47:59 | remi.lapeyre | link | issue40713 messages |
2020-05-21 13:47:59 | remi.lapeyre | create | |
|