summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-05-21 17:15:53 (GMT)
committerGitHub <noreply@github.com>2020-05-21 17:15:53 (GMT)
commitc817a1c4de1ff1f475776fd1fe8fe158695e53a5 (patch)
tree0d21355fd335ba6e3c222d2356b0d704dcb32681
parent3e650545bfe949fa435b0d41e54986f615891ec8 (diff)
downloadcpython-c817a1c4de1ff1f475776fd1fe8fe158695e53a5.zip
cpython-c817a1c4de1ff1f475776fd1fe8fe158695e53a5.tar.gz
cpython-c817a1c4de1ff1f475776fd1fe8fe158695e53a5.tar.bz2
[3.9] bpo-40714: Remove compile warning from _zoneinfo.c (GH-20291) (GH-20293)
(cherry picked from commit a487a39dca4c41305928c7dfdbcb0b3aa344683b) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com> Automerge-Triggered-By: @corona10
-rw-r--r--Modules/_zoneinfo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c
index 9f5e64d..d7e7157 100644
--- a/Modules/_zoneinfo.c
+++ b/Modules/_zoneinfo.c
@@ -1457,7 +1457,9 @@ parse_tz_str(PyObject *tz_str_obj, _tzrule *out)
PyObject *dst_abbr = NULL;
TransitionRuleType *start = NULL;
TransitionRuleType *end = NULL;
- long std_offset, dst_offset;
+ // Initialize offsets to invalid value (> 24 hours)
+ long std_offset = 1 << 20;
+ long dst_offset = 1 << 20;
char *tz_str = PyBytes_AsString(tz_str_obj);
if (tz_str == NULL) {
@@ -1907,7 +1909,7 @@ build_tzrule(PyObject *std_abbr, PyObject *dst_abbr, long std_offset,
long dst_offset, TransitionRuleType *start,
TransitionRuleType *end, _tzrule *out)
{
- _tzrule rv = {0};
+ _tzrule rv = {{0}};
rv.start = start;
rv.end = end;