connectivity/source/manager/mdrivermanager.cxx |    4 ++--
 hwpfilter/source/hstyle.cxx                    |    4 ++--
 sal/osl/unx/thread.cxx                         |    2 +-
 sal/rtl/byteseq.cxx                            |    7 +++++++
 sal/rtl/hash.cxx                               |    2 +-
 vcl/source/window/layout.cxx                   |   12 ++++++------
 6 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 2e56b56894c4176e9e7ce88a27b90f7687e118ed
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Wed Apr 3 23:58:18 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Aug 27 15:13:34 2024 +0200

    A number of bogus GCC 13 warnings still hit with recent GCC 14 trunk
    
    Change-Id: I0ec7743cd79429591fcfc3eb9715ff36d06fc00b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165765
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 6b7245f51274424a6c634424161e8766f8827033)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172464
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/connectivity/source/manager/mdrivermanager.cxx 
b/connectivity/source/manager/mdrivermanager.cxx
index 5c283be5d82d..c0c979079946 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -601,12 +601,12 @@ Reference< XDriver > 
OSDBCDriverManager::implGetDriverForURL(const OUString& _rU
                 m_aDriversBS.end(),         // end of search range
                 [&_rURL, this] (const DriverAccessArray::value_type& 
driverAccess) {
                     // extract the driver from the access, then ask the 
resulting driver for acceptance
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
                     const DriverAccess& ensuredAccess = 
EnsureDriver(m_xContext)(driverAccess);
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
                     const Reference<XDriver> driver = 
ExtractDriverFromAccess()(ensuredAccess);
diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx
index 013f755496a5..9a0040edcf08 100644
--- a/hwpfilter/source/hstyle.cxx
+++ b/hwpfilter/source/hstyle.cxx
@@ -68,14 +68,14 @@ void HWPStyle::SetName(int n, char const* name)
 
     if (name)
     {
-#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 13) && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 14) && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wstringop-truncation"
 #endif
         auto const p = style[n].name;
         strncpy(p, name, MAXSTYLENAME);
         p[MAXSTYLENAME] = '
-#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 13) && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 14) && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
     }
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 5639d8e62d57..ec4331528f9a 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -954,12 +954,12 @@ array_type assembleGrid(const VclGrid &rGrid)
     {
         for (sal_Int32 y = 0; y < nMaxY; ++y)
         {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
             const GridEntry &rEntry = A[x][y];
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
             const vcl::Window *pChild = rEntry.pChild;
@@ -1084,12 +1084,12 @@ static void calcMaxs(const array_type &A, 
std::vector<VclGrid::Value> &rWidths,
     {
         for (sal_Int32 y = 0; y < nMaxY; ++y)
         {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
             const GridEntry &rEntry = A[x][y];
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
             const vcl::Window *pChild = rEntry.pChild;
@@ -1122,12 +1122,12 @@ static void calcMaxs(const array_type &A, 
std::vector<VclGrid::Value> &rWidths,
     {
         for (sal_Int32 y = 0; y < nMaxY; ++y)
         {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
             const GridEntry &rEntry = A[x][y];
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
             const vcl::Window *pChild = rEntry.pChild;
commit dc59440aa41835f03268c41fd95c87c887697681
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Sun Dec 24 13:12:52 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Aug 27 15:13:29 2024 +0200

    -Werror=calloc-transposed-args
    
    Change-Id: I7b8b020bdbcd5b4db4cb478cc5fe1225f19ae0cf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161268
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 4663c56edf788a37545f253e028db99e480feb34)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172463
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx
index b17f363511c6..3d51f4ab2a33 100644
--- a/sal/osl/unx/thread.cxx
+++ b/sal/osl/unx/thread.cxx
@@ -624,7 +624,7 @@ static oslThreadIdentifier insertThreadId (pthread_t 
hThread)
 
     if (pEntry == nullptr)
     {
-        pEntry = static_cast<HashEntry*>(calloc(sizeof(HashEntry), 1));
+        pEntry = static_cast<HashEntry*>(calloc(1, sizeof(HashEntry)));
 
         pEntry->Handle = hThread;
 
diff --git a/sal/rtl/hash.cxx b/sal/rtl/hash.cxx
index 7cfc443cb972..4e255d965e17 100644
--- a/sal/rtl/hash.cxx
+++ b/sal/rtl/hash.cxx
@@ -79,7 +79,7 @@ static StringHashTable * rtl_str_hash_new(sal_uInt32 nSize)
 
     pHash->nEntries = 0;
     pHash->nSize = getNextSize (nSize);
-    pHash->pData = static_cast< rtl_uString ** >(calloc(sizeof(rtl_uString *), 
pHash->nSize));
+    pHash->pData = static_cast< rtl_uString ** >(calloc(pHash->nSize, 
sizeof(rtl_uString *)));
 
     return pHash;
 }
commit 4bca3c8a288f0d2dcee353284f76bf0d60c6732f
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Sun Dec 24 13:14:53 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Aug 27 15:13:25 2024 +0200

    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>
    (cherry picked from commit 5e3af4aec40531b490950da5ed49342a01c1477b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172462
    Reviewed-by: Michael Stahl <michael.st...@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