linguistic/source/lngsvcmgr.cxx          |    7 +++++++
 vcl/source/filter/png/PngImageReader.cxx |    7 +++++++
 2 files changed, 14 insertions(+)

New commits:
commit 745ba22017fde53b50f38a1db5c3eaa388003871
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri Apr 5 16:43:08 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri Apr 5 20:06:08 2024 +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 <stephan.bergm...@allotropia.de>

diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 8ab2efd46ad9..bb503360fbdf 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
 {
commit 2bcd9fe0fa10339294e6ab820498fa18334e02f3
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri Apr 5 16:55:28 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri Apr 5 20:05:58 2024 +0200

    Silence strange -Wclobbered with recent GCC 14
    
    ...seen at least with some (--enable-dbgutil --enable-otpimized etc.)
    configuration and a recent GCC 14 trunk,
    
    > vcl/source/filter/png/PngImageReader.cxx: In function ‘bool 
{anonymous}::reader(SvStream&, Graphic&, GraphicFilterImportFlags, 
BitmapScopedWriteAccess*, BitmapScopedWriteAccess*)’:
    > vcl/source/filter/png/PngImageReader.cxx:361:16: error: variable 
‘bSupportsBitmap32’ might be clobbered by ‘longjmp’ or ‘vfork’ 
[-Werror=clobbered]
    >   361 |     const bool bSupportsBitmap32 = bFuzzing || 
ImplGetSVData()->mpDefInst->supportsBitmap32();
    >       |                ^~~~~~~~~~~~~~~~~
    
    Change-Id: Icc1932347a213877ecc9f561f98de779f8041c09
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165823
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index 0445aff40af9..61bfb9a0f16d 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -322,6 +322,10 @@ bool fcTLbeforeIDAT(SvStream& rStream)
     return false;
 }
 
+#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wclobbered"
+#endif
 bool reader(SvStream& rStream, Graphic& rGraphic,
             GraphicFilterImportFlags nImportFlags = 
GraphicFilterImportFlags::NONE,
             BitmapScopedWriteAccess* pAccess = nullptr,
@@ -817,6 +821,9 @@ BinaryDataContainer getMsGifChunk(SvStream& rStream)
             return {};
     }
 }
+#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__
+#pragma GCC diagnostic pop
+#endif
 
 } // anonymous namespace
 

Reply via email to