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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3, 10.4
    • Fix Version/s: 10.3.11, 10.4.0
    • Component/s: OTHER
    • Labels:
      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

            Assignee:
            bar Alexander Barkov
            Reporter:
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: