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

GCC 13 -Wdangling-pointer in execute_show_status()

    XMLWordPrintable

Details

    Description

      GCC 13 emits a new warning for some old code from 2006:

      10.4 9c0e91a27cc58d1b5076435e125c70cd277fd989

      /mariadb/10.4/sql/sql_parse.cc: In function 'bool execute_show_status(THD*, TABLE_LIST*)':
      /mariadb/10.4/sql/sql_parse.cc:6506:26: error: storing the address of local variable 'old_status_var' in '*thd.THD::initial_status_var' [-Werror=dangling-pointer=]
       6506 |   thd->initial_status_var= &old_status_var;
      

      Possibly this could be fixed by allocating old_status_var from the heap. I don’t think that alloca() would help here.

      Attachments

        Activity

          People

            cvicentiu Vicențiu Ciorbaru
            marko Marko Mäkelä
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.