linguistic/source/lngsvcmgr.cxx |    7 +++++++
 vcl/source/helper/strhelper.cxx |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit b288ca5a5c7f68b5ee0a46f4ce12ea3032765510
Author:     Julien Nabet <[email protected]>
AuthorDate: Fri Aug 23 09:41:20 2024 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Oct 2 16:40:46 2025 +0200

    vcl: WhitespaceToSpace() spurious -Werror=maybe-uninitialized (gcc14)
    
    Change-Id: Ie683c1f8cc8b88da4ca3b26f4621a16f742f03f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172303
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <[email protected]>
    (cherry picked from commit 4d8fdb32e7f054f2d8704121a60f830524fe7796)
    (cherry picked from commit ff492183fd841e265c7e0eff1a8de6c838124d0c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191784
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index ebe48d1200ef..e954a77c80a4 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)
+#if defined(__GNUC__) && (__GNUC__ == 12 || __GNUC__ == 13 || __GNUC__ == 14)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
     if( *pLeap == ' ' )
         *pLeap = 0;
-#if defined(__GNUC__) && (__GNUC__ == 12 || __GNUC__ == 13)
+#if defined(__GNUC__) && (__GNUC__ == 12 || __GNUC__ == 13 || __GNUC__ == 14)
 #pragma GCC diagnostic pop
 #endif
     return *pBuffer == ' ' ? pBuffer+1 : pBuffer;
commit c3dd9b8ec0976a33778d2e85c6203aff0908ac95
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Fri Apr 5 16:43:08 2024 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Oct 2 16:40:41 2025 +0200

    Silence strange -Wmaybe-uninitialized with recent GCC 14
    
    ...seen at least with some (--enable-dbgutil --enable-otpimized etc.)
    configuration and a recent GCC 14 trunk,
    
    > In file included from ~/gcc/inst/include/c++/14.0.1/vector:66,
    >                  from include/unotools/options.hxx:26,
    >                  from include/unotools/lingucfg.hxx:27,
    >                  from linguistic/source/lngsvcmgr.cxx:35:
    > In destructor ‘constexpr std::__cxx1998::vector< 
<template-parameter-1-1>, <template-parameter-1-2> >::~vector() [with _Tp = 
SvcInfo; _Alloc = std::allocator<SvcInfo>]’,
    >     inlined from ‘constexpr std::__debug::vector<_Tp, 
_Allocator>::~vector() [with _Tp = SvcInfo; _Allocator = 
std::allocator<SvcInfo>]’ at ~/gcc/inst/include/c++/14.0.1/debug/vector:245:7,
    >     inlined from ‘constexpr void 
std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp = 
std::__debug::vector<SvcInfo>]’ at 
~/gcc/inst/include/c++/14.0.1/optional:283:35,
    >     inlined from ‘constexpr void 
std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp = 
std::__debug::vector<SvcInfo>]’ at 
~/gcc/inst/include/c++/14.0.1/optional:314:14,
    >     inlined from ‘constexpr std::_Optional_payload<_Tp, false, _Copy, 
_Move>::~_Optional_payload() [with _Tp = std::__debug::vector<SvcInfo>; bool 
_Copy = false; bool _Move = false]’ at 
~/gcc/inst/include/c++/14.0.1/optional:437:65,
    >     inlined from ‘constexpr 
std::_Optional_base<std::__debug::vector<SvcInfo>, false, 
false>::~_Optional_base()’ at ~/gcc/inst/include/c++/14.0.1/optional:508:12,
    >     inlined from ‘constexpr std::optional<std::__debug::vector<SvcInfo> 
>::~optional()’ at ~/gcc/inst/include/c++/14.0.1/optional:703:11,
    >     inlined from ‘LngSvcMgr::~LngSvcMgr()’ at 
linguistic/source/lngsvcmgr.cxx:519:1:
    > ~/gcc/inst/include/c++/14.0.1/bits/stl_vector.h:735:22: error: 
‘((std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> >*)((char*)this + 
16))[22].std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> 
>::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>::_M_impl.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>::_Vector_impl::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>::_Vector_impl_data.std::__cxx1998::_Vector_base<SvcInfo, 
std::allocator<SvcInfo> >::_Vector_impl_data::_M_finish’ may be used 
uninitialized [-Werror=maybe-uninitialized]
    >   735 |         std::_Destroy(this->_M_impl._M_start, 
this->_M_impl._M_finish,
    >       |         
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    >   736 |                       _M_get_Tp_allocator());
    >       |                       ~~~~~~~~~~~~~~~~~~~~~~
    > ~/gcc/inst/include/c++/14.0.1/bits/stl_vector.h:735:22: error: 
‘((std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> >*)((char*)this + 
16))[22].std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> 
>::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>::_M_impl.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>::_Vector_impl::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> 
>::_Vector_impl_data.std::__cxx1998::_Vector_base<SvcInfo, 
std::allocator<SvcInfo> >::_Vector_impl_data::_M_start’ may be used 
uninitialized [-Werror=maybe-uninitialized]
    
    Change-Id: I02815c39ee6026b4637a4bb6ad2804af7a446a57
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165821
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 745ba22017fde53b50f38a1db5c3eaa388003871)
    (cherry picked from commit 7ad5fa555e09636e4f6947935202744ccba6af98)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191783
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 11b5440da5d4..98a6c09b88a8 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -504,6 +504,10 @@ void LngSvcMgr::disposing(const lang::EventObject&)
     stopListening();
 }
 
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 14
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
 LngSvcMgr::~LngSvcMgr()
 {
     stopListening();
@@ -517,6 +521,9 @@ LngSvcMgr::~LngSvcMgr()
     pAvailHyphSvcs.reset();
     pAvailThesSvcs.reset();
 }
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 14
+#pragma GCC diagnostic pop
+#endif
 
 namespace
 {

Reply via email to