comphelper/source/streaming/memorystream.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5cf5df83aad9c9c97060043727337bdef8af10ec
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Sun May 22 11:06:43 2022 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Mon May 23 09:42:24 2022 +0200

    comphelper: -Werror=class-memaccess
    
    Change-Id: Ia38274fac70618902f562fec657ad9cccfcf8cb3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134735
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/comphelper/source/streaming/memorystream.cxx 
b/comphelper/source/streaming/memorystream.cxx
index 7edfe7a78ce0..ea1a955cb4d4 100644
--- a/comphelper/source/streaming/memorystream.cxx
+++ b/comphelper/source/streaming/memorystream.cxx
@@ -218,7 +218,8 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< 
sal_Int8 >& aData )
 
     NoInitInt8* pData = &(*maData.begin());
     NoInitInt8* pCursor = &(pData[mnCursor]);
-    memcpy( pCursor, aData.getConstArray(), nBytesToWrite );
+    // cast to avoid -Werror=class-memaccess
+    memcpy(static_cast<void*>(pCursor), aData.getConstArray(), nBytesToWrite);
 
     mnCursor += nBytesToWrite;
 }

Reply via email to