sal/rtl/byteseq.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 5e3af4aec40531b490950da5ed49342a01c1477b
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Sun Dec 24 13:14:53 2023 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Sun Dec 24 14:58:09 2023 +0100

    Silence new GCC 14 trunk -Werror=alloc-size
    
    > sal/rtl/byteseq.cxx: In function ‘void 
rtl_byte_sequence_reference2One(sal_Sequence**)’:
    > sal/rtl/byteseq.cxx:63:20: error: allocation of insufficient size ‘8’ for 
type ‘sal_Sequence’ {aka ‘_sal_Sequence’} with size ‘12’ [-Werror=alloc-size]
    >    63 |             pNew = static_cast<sal_Sequence *>(malloc( 
SAL_SEQUENCE_HEADER_SIZE ));
    >       |                    
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Change-Id: I9d4081ed2938fffdf282c852250a3eed5f0d9e25
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161269
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/sal/rtl/byteseq.cxx b/sal/rtl/byteseq.cxx
index 3c4967d5456d..0084f3969812 100644
--- a/sal/rtl/byteseq.cxx
+++ b/sal/rtl/byteseq.cxx
@@ -60,7 +60,14 @@ void SAL_CALL rtl_byte_sequence_reference2One(
         }
         else
         {
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 14
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Walloc-size"
+#endif
             pNew = static_cast<sal_Sequence *>(malloc( 
SAL_SEQUENCE_HEADER_SIZE ));
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 14
+#pragma GCC diagnostic pop
+#endif
         }
 
         if ( pNew != nullptr )

Reply via email to