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

Insert cast to suppress -Wdynamic-class-memaccess

Details

    • 10.1.14

    Description

      The clang -Wdynamic-class-memaccess warning is triggered when a Duplicate_weedout_picker's vtable is overwritten with memcpy or memset

      mariadb-server/sql/sql_select.cc:24654:10: warning: destination for this 'memset' call is a pointer to class containing a dynamic class 'Duplicate_weedout_picker'; vtable pointer will be overwritten
            [-Wdynamic-class-memaccess]
        memset(best_positions, 0, sizeof(POSITION) * (table_count + 1));
      mariadb-server/sql/sql_select.cc:24654:10: note: explicitly cast the pointer to silence this warning
        memset(best_positions, 0, sizeof(POSITION) * (table_count + 1));
      mariadb-server/sql/opt_subselect.cc:2246:21: warning: destination for this 'memcpy' call is a pointer to class containing a dynamic class 'Duplicate_weedout_picker'; vtable pointer will be overwritten
            [-Wdynamic-class-memaccess]
              memcpy(sjm->positions, join->best_positions + join->const_tables, 
      mariadb-server/sql/opt_subselect.cc:2246:21: note: explicitly cast the pointer to silence this warning
              memcpy(sjm->positions, join->best_positions + join->const_tables, 
      mariadb-server/sql/opt_subselect.cc:3350:32: warning: destination for this 'memcpy' call is a pointer to class containing a dynamic class 'Duplicate_weedout_picker'; vtable pointer will be overwritten
            [-Wdynamic-class-memaccess]
            memcpy(pos - sjm->tables + 1, sjm->positions, 
      mariadb-server/sql/opt_subselect.cc:3350:32: note: explicitly cast the pointer to silence this warning
            memcpy(pos - sjm->tables + 1, sjm->positions, 
      mariadb-server/sql/opt_subselect.cc:3366:35: warning: destination for this 'memcpy' call is a pointer to class containing a dynamic class 'Duplicate_weedout_picker'; vtable pointer will be overwritten
            [-Wdynamic-class-memaccess]
            memcpy(join->best_positions + first, 
      mariadb-server/sql/opt_subselect.cc:3366:35: note: explicitly cast the pointer to silence this warning
            memcpy(join->best_positions + first,
      

      Attachments

        Activity

          davidgow David Gow created issue -
          svoj Sergey Vojtovich made changes -
          Field Original Value New Value
          Assignee Sergey Vojtovich [ svoj ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0 [ 16000 ]
          svoj Sergey Vojtovich made changes -
          Labels foundation
          ratzpo Rasmus Johansson (Inactive) made changes -
          Sprint 10.1.14 [ 51 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Rank Ranked lower
          svoj Sergey Vojtovich made changes -
          Summary [PATCH] Insert cast to suppress -Wdynamic-class-memaccess Insert cast to suppress -Wdynamic-class-memaccess
          svoj Sergey Vojtovich made changes -
          Labels foundation contribution foundation
          svoj Sergey Vojtovich made changes -
          Component/s Compiling [ 11001 ]
          Fix Version/s 10.0.25 [ 21701 ]
          Fix Version/s 10.1.14 [ 21804 ]
          Fix Version/s 10.2.1 [ 22012 ]
          Fix Version/s 10.0 [ 16000 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.2.1 [ 22012 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 75459 ] MariaDB v4 [ 150375 ]

          People

            svoj Sergey Vojtovich
            davidgow David Gow
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.