10000 bpo-40714: Remove compile warning from _zoneinfo.c (GH-20291) · python/cpython@a487a39 · GitHub
[go: up one dir, main page]

Skip to content

Commit a487a39

Browse files
authored
bpo-40714: Remove compile warning from _zoneinfo.c (GH-20291)
1 parent e16d2f7 commit a487a39

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Modules/_zoneinfo.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,9 @@ parse_tz_str(PyObject *tz_str_obj, _tzrule *out)
14571457
PyObject *dst_abbr = NULL;
14581458
TransitionRuleType *start = NULL;
14591459
TransitionRuleType *end = NULL;
1460-
long std_offset, dst_offset;
1460+
// Initialize offsets to invalid value (> 24 hours)
1461+
long std_offset = 1 << 20;
1462+
long dst_offset = 1 << 20;
14611463

14621464
char *tz_str = PyBytes_AsString(tz_str_obj);
14631465
if (tz_str == NULL) {
@@ -1907,7 +1909,7 @@ build_tzrule(PyObject *std_abbr, PyObject *dst_abbr, long std_offset,
19071909
long dst_offset, TransitionRuleType *start,
19081910
TransitionRuleType *end, _tzrule *out)
19091911
{
1910-
_tzrule rv = {0};
1912+
_tzrule rv = {{0}};
19111913

19121914
rv.start = start;
19131915
rv.end = end;

0 commit comments

Comments
 (0)
0