classification
Title: Remove compile warning from _zoneinfo.c
Type: enhancement Stage: resolved
Components: Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: corona10, miss-islington, p-ganssle
Priority: normal Keywords: patch

Created on 2020-05-21 15:54 by corona10, last changed 2020-05-21 17:16 by corona10. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20291 merged corona10, 2020-05-21 15:55
PR 20293 merged miss-islington, 2020-05-21 16:56
Messages (4)
msg369525 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-05-21 15:54
/Users/corona10/oss/cpython/Modules/_zoneinfo.c:1487:9: warning: variable
      'dst_offset' is used uninitialized whenever 'if' condition is true
      [-Wsometimes-uninitialized]
    if (*p == '\0') {
        ^~~~~~~~~~
/Users/corona10/oss/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/corona10/oss/cpython/Modules/_zoneinfo.c:1487:5: note: remove the 'if' if
      its condition is always false
    if (*p == '\0') {
    ^~~~~~~~~~~~~~~~~
/Users/corona10/oss/cpython/Modules/_zoneinfo.c:1460:32: note: initialize the
      variable 'dst_offset' to silence this warning
    long std_offset, dst_offset;
                               ^
                                = 0
/Users/corona10/oss/cpython/Modules/_zoneinfo.c:1910:19: warning: suggest braces
      around initialization of subobject [-Wmissing-braces]
    _tzrule rv = {0};
                  ^
                  {}
msg369526 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-05-21 15:57
It happened from clang compiler of macOS.
Clang 11.0.3 (clang-1103.0.32.29)]
msg369528 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-05-21 16:56
New changeset a487a39dca4c41305928c7dfdbcb0b3aa344683b by Dong-hee Na in branch 'master':
bpo-40714: Remove compile warning from _zoneinfo.c (GH-20291)
https://github.com/python/cpython/commit/a487a39dca4c41305928c7dfdbcb0b3aa344683b
msg369529 - (view) Author: miss-islington (miss-islington) Date: 2020-05-21 17:16
New changeset c817a1c4de1ff1f475776fd1fe8fe158695e53a5 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-40714: Remove compile warning from _zoneinfo.c (GH-20291) (GH-20293)
https://github.com/python/cpython/commit/c817a1c4de1ff1f475776fd1fe8fe158695e53a5
History
Date User Action Args
2020-05-21 17:16:41corona10setstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-05-21 17:16:03miss-islingtonsetmessages: + msg369529
2020-05-21 16:56:21miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request19568
2020-05-21 16:56:19corona10setmessages: + msg369528
2020-05-21 16:08:26corona10setversions: + Python 3.9
2020-05-21 15:57:20corona10setnosy: + p-ganssle
messages: + msg369526
2020-05-21 15:55:13corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request19566
2020-05-21 15:54:27corona10create