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

10.3: gcc-8.0 produces lots of -Wclass-memaccess warnings in Table_scope_and_contents_source_st

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3(EOL), 10.4(EOL)
    • 10.3.11, 10.4.0
    • OTHER
    • None

    Description

      • Note: the problem is repeatable with 10.2 and earlier versions as well. But in 10.2 and earlier we don't have Vers_parse_info, so it can be fixed by a simpler (but not future proof) patch, e.g. casting "this" to void*. Using cast to void is dangerous though, so it should be avoided in 10.3+.
      • Note: 10.2 and earlier versions will be fixed under terms of a separate MDEV

      gcc-8.0 has a new warning when a class or struct with a constructor is bzero'd.

      A lot of warnings if this kind are generated by this method:

      struct Table_scope_and_contents_source_st
      ..
        void init()
        {
          bzero(this, sizeof(*this));
        }
      ..
      

      This structure has non-trivial members:

      • SQL_I_List<TABLE_LIST> merge_list;
      • Vers_parse_info vers_info;

      which have constructors.

      So bzero'ing is not indeed logically correct. Moveover, the constructor of SQL_I_LIST does more than just bzero.

      This should be fixed.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            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.