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

compiler complains about uninitialized variable.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2
    • 10.2.9
    • JSON
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.