From 892bc8a15a09081b3de0afb9420abb5c2d110ea4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 16 Jul 2021 12:07:40 +0200 Subject: [PATCH] -Werror=class-memaccess MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc doesn't like memcpy here error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] 1459 | memcpy(p, other.m_pairs, m_size * sizeof(WhichPair)); Change-Id: I44055d0d4dec589af7f98d62f106b701f1f5a4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119063 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svl/source/items/itemset.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index f96d0c9c8ef1..324cf6da69f0 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -1418,7 +1418,8 @@ SfxItemSet SfxAllItemSet::CloneAsValue(bool , SfxItemPool * ) const WhichRangesContainer::WhichRangesContainer( const WhichPair* wids, sal_Int32 nSize ) { auto p = new WhichPair[nSize]; - memcpy(p, wids, nSize * sizeof(WhichPair)); + for (int i=0; i