From 6f2ca4eac167a12529f6062b300d89af83b310ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 22 Jan 2020 10:06:02 +0200 Subject: [PATCH] MDEV-21263: Fix -Wclass-memaccess Since commit f52bf92014efae6a1da9c2f26a7e3792ed5f5396 the type Sql_sort is non-trivial, because it includes a data member Bounds_checked_array local_sortorder. There still is no vtable, so memset() is safe to invoke, but we must add a cast to silence a warning in GCC 8 or later. --- sql/sql_sort.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_sort.h b/sql/sql_sort.h index 430f313631f..2c01b01b607 100644 --- a/sql/sql_sort.h +++ b/sql/sql_sort.h @@ -300,7 +300,7 @@ public: Sort_param() { - memset(this, 0, sizeof(*this)); + memset(reinterpret_cast(this), 0, sizeof(*this)); } void init_for_filesort(uint sortlen, TABLE *table, ha_rows maxrows, bool sort_positions);