Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-13786

compiler complains about uninitialized variable.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2
    • Fix Version/s: 10.2.9
    • Component/s: JSON
    • Labels:
      None

      Description

      Compiler complains like this:

      /mariadb/10.2/sql/item_jsonfunc.cc:878:7: warning: variable 'i' is used
      uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (read_json(NULL, &type, &value, &value_len) != NULL)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /mariadb/10.2/sql/item_jsonfunc.cc:898:10: note: uninitialized use occurs here
      return i;
      ^
      /mariadb/10.2/sql/item_jsonfunc.cc:878:3: note: remove the 'if' if its condition
      is always true
      if (read_json(NULL, &type, &value, &value_len) != NULL)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /mariadb/10.2/sql/item_jsonfunc.cc:876:13: note: initialize the variable 'i' to
      silence this warning
      longlong i;
      ^
      = 0

        Attachments

          Activity

            People

            Assignee:
            holyfoot Alexey Botchkov
            Reporter:
            holyfoot Alexey Botchkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: