hwpfilter/source/hstyle.cxx     |    4 ++--
 linguistic/source/lngsvcmgr.cxx |    4 ++--
 sfx2/source/dialog/splitwin.cxx |    5 +++--
 sw/source/core/doc/doc.cxx      |   11 ++---------
 vcl/source/helper/strhelper.cxx |    4 ++--
 5 files changed, 11 insertions(+), 17 deletions(-)

New commits:
commit a2266a7e884dc93e3bf9237028d1a062f81e7c93
Author:     Julien Nabet <[email protected]>
AuthorDate: Wed May 1 15:50:50 2024 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Oct 2 17:02:38 2025 +0200

    Silence some bogus -Werror=array-bounds etc. also with GCC 13 and -std=c++20
    
    See 1c3c27bc2e42f70e588ef5dbc769a8a346042e04
    Silence some bogus -Werror=array-bounds etc. with GCC 12 and -std=c++20
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166966
    Reviewed-by: Julien Nabet <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit a835b40e05462e9be58cb501aa6b938f3dc998b8)
    (cherry picked from commit a7f5617562ed1eb3a7223930fb6366da42361a7e)
    
    Silence some bogus -Werror=array-bounds etc. also with GCC 14 and -std=c++20
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172310
    Reviewed-by: Julien Nabet <[email protected]>
    Tested-by: Julien Nabet <[email protected]>
    (cherry picked from commit 6e51d65c3d8031967727092ee2f48b8577db9b85)
    (cherry picked from commit 3e7734dc1c5e1b5b58311670f1a55dc18ffb840f)
    
    cid#1607883 Overflowed constant
    
    Change-Id: Ib01a9c72b2e5684552af22e3ef64a33358eacb9d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175804
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 011d5bbd068f00c9477b1fd68e8ba297d4e6998a)
    (cherry picked from commit 6092e6f5461b05defc6fc5325ce2605a0babdde6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191787
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 4bcb2a35e856..288c85a03be6 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -992,15 +992,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
     // just one page is special ...
     if ( 1 == aVec.size() )
     {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 12 && __cplusplus == 
202002L
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warray-bounds"
-#pragma GCC diagnostic ignored "-Wstringop-overflow"
-#endif
-        aVec.insert( aVec.begin() + 1, nullptr ); // insert a second empty page
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 12 && __cplusplus == 
202002L
-#pragma GCC diagnostic pop
-#endif
+        aVec.push_back( nullptr ); // insert a second empty page
     }
     else
     {
@@ -1014,6 +1006,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
     // make sure that all pages are in correct order
     std::vector< const SwPageFrame * >::size_type nSPg = 0;
     std::vector< const SwPageFrame * >::size_type nEPg = aVec.size();
+    assert(nEPg >= 2);
     sal_Int32 nStep = 1;
     if ( 0 == (nEPg & 1 ))      // there are no uneven ones!
         --nEPg;
commit bd171157bd026dfbe31c8d03e8c326451360ac15
Author:     Julien Nabet <[email protected]>
AuthorDate: Fri Aug 23 10:56:27 2024 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Oct 2 17:02:35 2025 +0200

    -Werror=maybe-uninitialized in sfx2
    
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member 
function ‘void SfxSplitWindow::InsertWindow(SfxDockingWindow*, const Size&)’:
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:462:23: error: 
‘nL’ may be used uninitialized [-Werror=maybe-uninitialized]
      462 |                 nLine = static_cast<short>(nL);
          |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:433:16: note: 
‘nL’ was declared here
      433 |     sal_uInt16 nL;
          |                ^~
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member 
function ‘void SfxSplitWindow::MoveWindow(SfxDockingWindow*, const Size&, 
sal_uInt16, sal_uInt16, bool)’:
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:552:21: error: 
‘nL’ may be used uninitialized [-Werror=maybe-uninitialized]
      552 |     if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 )
          |          ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:548:16: note: 
‘nL’ was declared here
      548 |     sal_uInt16 nL, nP;
          |                ^~
    
    Change-Id: I816ec49fe2c63e4f448ae83251d3a24b08383903
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172306
    Reviewed-by: Julien Nabet <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 73884e28faeb457c01b80051a701c073112ad564)
    (cherry picked from commit 6348e98173f0f4a361e893cb272f44c902bd86ee)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191786
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 210a9dbeaaff..61903bb13d6c 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -429,7 +429,6 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* 
pDockWin, const Size& rSize
 */
 {
     short nLine = -1;  // so that the first window cab set nline to 0
-    sal_uInt16 nL;
     sal_uInt16 nPos = 0;
     bool bNewLine = true;
     bool bSaveConfig = false;
@@ -456,6 +455,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* 
pDockWin, const Size& rSize
             if ( bNewLine && !pFoundDock )
             {
                 // Not known until now in which real line it is located
+                sal_uInt16 nL = 0;
                 GetWindowPos( rDock.pWin, nL, nPos );
                 nLine = static_cast<short>(nL);
             }
@@ -543,7 +543,8 @@ void SfxSplitWindow::MoveWindow( SfxDockingWindow* 
pDockWin, const Size& rSize,
 */
 
 {
-    sal_uInt16 nL, nP;
+    sal_uInt16 nL = 0;
+    sal_uInt16 nP = 0;
     GetWindowPos( pDockWin, nL, nP );
 
     if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 )
commit 3336553783406823fdad994ce034ae5dfe541af3
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Thu Jul 24 08:21:37 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Oct 2 17:02:31 2025 +0200

    Some bugus warnings still hit with GCC 15
    
    ...at least with gcc-15.1.1-2.fc42.x86_64, when doing optimizing LO builds
    
    Change-Id: I5df92c8503a88727d31f8e1920a2cd744d3ab790
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188258
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 294858f8ff546dc0d42e83745dc0ab937396f20c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189336
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 20bbbe12ea977acd4ae9cef6a9a15a976d74ccb3)
    (cherry picked from commit cf2bbec1e6eefc17b4e7fcec8993f0eab5344cbd)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191785

diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx
index 9a0040edcf08..3221f73f8624 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__ <= 14) && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 15) && !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__ <= 14) && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 15) && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
     }
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 98a6c09b88a8..1cedca0db651 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -504,7 +504,7 @@ void LngSvcMgr::disposing(const lang::EventObject&)
     stopListening();
 }
 
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 14
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 14 && __GNUC__ <= 15
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
@@ -521,7 +521,7 @@ LngSvcMgr::~LngSvcMgr()
     pAvailHyphSvcs.reset();
     pAvailThesSvcs.reset();
 }
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 14
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 14 && __GNUC__ <= 15
 #pragma GCC diagnostic pop
 #endif
 
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index e954a77c80a4..37a79b1232ec 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -363,13 +363,13 @@ OString WhitespaceToSpace(std::string_view rLine)
     // there might be a space at beginning or end
     assert(pLeap > pBuffer);
     pLeap--;
-#if defined(__GNUC__) && (__GNUC__ == 12 || __GNUC__ == 13 || __GNUC__ == 14)
+#if defined(__GNUC__) && __GNUC__ >= 12 && __GNUC__ <= 15
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
     if( *pLeap == ' ' )
         *pLeap = 0;
-#if defined(__GNUC__) && (__GNUC__ == 12 || __GNUC__ == 13 || __GNUC__ == 14)
+#if defined(__GNUC__) && __GNUC__ >= 12 && __GNUC__ <= 15
 #pragma GCC diagnostic pop
 #endif
     return *pBuffer == ' ' ? pBuffer+1 : pBuffer;

Reply via email to