maybe-uninitialized warning in timelib

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Query Execution 2021-05-31
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      I saw this on gcc-10 when compiling with -O3. It doesn't show up with -O2, probably due to less aggressive inlining not making it visible to the compiler.

      src/third_party/timelib-2018.01/parse_tz.c: In function 'timelib_get_time_zone_info':
      src/third_party/timelib-2018.01/parse_tz.c:677:24: error: 'transition_time' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      

      It seems like a valid warning since `transition_time` won't be initialized if this return path is taken https://github.com/mongodb/mongo/blob/144e0d0f355dd5ec13a1aa135a1f59a90d234aa5/src/third_party/timelib-2018.01/parse_tz.c#L622. Initializing to 0 at https://github.com/mongodb/mongo/blob/144e0d0f355dd5ec13a1aa135a1f59a90d234aa5/src/third_party/timelib-2018.01/parse_tz.c#L671 seems to silence the warning.

            Assignee:
            Mohammad Dashti (Inactive)
            Reporter:
            Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: