Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55066

maybe-uninitialized warning in timelib

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Sprint:
      Query Execution 2021-05-31

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mohammad.dashti Mohammad Dashti
              Reporter:
              redbeard0531 Mathias Stearn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: