Commit Graph
100 Commits
Author SHA1 Message Date
Stephan Bergmann e8cd1878f6 Lets see if an empty sanitize-ubsan-excludelist is enough these days
...after 50f1498332 "Remove ten year old file that
is unused" removed it completely and thus broke
<https://ci.libreoffice.org/job/lo_ubsan/3808/>.  (And if an empty file turns
out to be enough, we can either remove it completely in a second step, from both
core and lode, or keep it around in case we ever need to add new content into
it.)

Change-Id: Ieedc93de5e98b76e754dcd9393e66ee64fbf42cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198581
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-02-03 10:23:20 +01:00
Stephan Bergmann 0c54c3f77a Point appears to be required to be a complete type here
...contrary to what c511c65434 "tdf#146619 Use
more forward declarations in include/tools" apparently assumed, as seen at least
with recent Clang 23 trunk against recent libstdc++ 16 trunk,

> In file included from tools/source/generic/poly2.cxx:22:
> In file included from tools/inc/poly.h:22:
> In file included from ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.1/../../../../include/c++/16.0.1/memory:80:
> ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.1/../../../../include/c++/16.0.1/bits/unique_ptr.h:131:18: error: invalid application of 'sizeof' to an incomplete type 'Point'
>   131 |           static_assert(sizeof(_Tp)>0,
>       |                         ^~~~~~~~~~~
> ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.1/../../../../include/c++/16.0.1/bits/unique_ptr.h:684:4: note: in instantiation of function template specialization 'std::default_delete<Point[]>::operator()<Point>' requested here
>   684 |           get_deleter()(__ptr);
>       |           ^
> tools/inc/poly.h:33:21: note: in instantiation of member function 'std::unique_ptr<Point[]>::~unique_ptr' requested here
>    33 |                     ImplPolygon() : mnPoints(0) {}
>       |                     ^
> include/tools/poly.hxx:60:7: note: forward declaration of 'Point'
>    60 | class Point;
>       |       ^

Change-Id: I0b96222dcec7e98b974151004248a91ba1854e60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198573
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-02-02 22:31:40 +01:00
Stephan Bergmann ea8780df8c -Werror,-Wunused-variable
...after f9fcd884a3 "tdf#166121 split
HandleDuplicateRecords method"

Change-Id: I9ed36b6afcc729198255becdca4c268d59af032e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198396
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-30 11:24:50 +01:00
Stephan Bergmann aee7b9b8e0 Avoid float-cast-overflow
...by completely getting rid of the code exhibiting UB and the helpless
workaround from 2b27652d2d "tdf#167892 fix hang
formatting very small number on windows".

TODO:  It is unclear to me whether using saturated values here is any better
than using whatever random values came out of the original code that exhibited
UB.  The whole algorithm probably needs to be replaced with something that
actually works.

(This was now reported with 4368272648
"tdf#167892: svl_qa_cppunit: Add test" as

> /svl/source/numbers/zformat.cxx:2886:52: runtime error: 1e+19 is outside the range of representable values of type 'long'
>     #0 0x7f3f6da013eb in SvNumberformat::ImpGetFractionElements(double&, unsigned short, double&, long&, long&) const /svl/source/numbers/zformat.cxx:2886:52
>     #1 0x7f3f6d9f84ee in SvNumberformat::ImpGetFractionOutput(double, unsigned short, bool, NativeNumberWrapper const&, rtl::OUStringBuffer&) const /svl/source/numbers/zformat.cxx:2961:5
>     #2 0x7f3f6d9e472a in SvNumberformat::GetOutputString(double, rtl::OUString&, Color const**, NativeNumberWrapper const&, SvNFLanguageData const&, bool) const /svl/source/numbers/zformat.cxx:2676:21
>     #3 0x7f3f6d8c37bc in SvNFEngine::GetPreviewString(SvNFLanguageData&, SvNFFormatData const&, NativeNumberWrapper const&, SvNFEngine::Accessor const&, rtl::OUString const&, double, rtl::OUString&, Color const**, o3tl::strong_int<unsigned short, LanguageTypeTag>, bool) /svl/source/numbers/zforlist.cxx:2147:20
>     #4 0x7f3f6d8c3ddb in SvNumberFormatter::GetPreviewString(rtl::OUString const&, double, rtl::OUString&, Color const**, o3tl::strong_int<unsigned short, LanguageTypeTag>, bool) /svl/source/numbers/zforlist.cxx:2165:12
>     #5 0x7f3f6ef90fd3 in (anonymous namespace)::Test::checkPreviewString(SvNumberFormatter&, rtl::OUString const&, double, o3tl::strong_int<unsigned short, LanguageTypeTag>, rtl::OUString const&) /svl/qa/unit/svl.cxx:462:21
>     #6 0x7f3f6ef67f13 in (anonymous namespace)::Test::testUserDefinedNumberFormats() /svl/qa/unit/svl.cxx:1443:9

<https://ci.libreoffice.org/job/lo_ubsan/3801/>.)

Change-Id: Iff449629ee309f9513af02da9dfdf2505d6fe725
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198278
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-28 13:15:46 +01:00
Stephan Bergmann 2c99f58b27 cppu_detail_getUnoType for PropertyValue should arguably be declared here
...contrary to what 31ea498486 "tdf#146619 Use
more forward declarations in include/vcl/[q-w]*" apparently assumed, as the dtor
of NotebookBarAddonsItem is implicitly defined inline here, and otherwise at
least recent Clang 23 trunk against recent libstdc++ 16 trunk would fail with

> In file included from vcl/source/control/combobox.cxx:20:
> In file included from include/vcl/toolkit/combobox.hxx:28:
> In file included from include/vcl/toolkit/edit.hxx:26:
> In file included from include/vcl/ctrl.hxx:26:
> In file included from include/vcl/window.hxx:24:
> In file included from include/vcl/outdev.hxx:28:
> In file included from include/tools/color.hxx:23:
> In file included from include/com/sun/star/uno/Any.hxx:35:
> In file included from include/com/sun/star/uno/Any.h:33:
> include/cppu/unotype.hxx:300:16: error: no matching function for call to 'cppu_detail_getUnoType'
>   300 |         return cppu_detail_getUnoType(static_cast< T1 * >(NULL));
>       |                ^~~~~~~~~~~~~~~~~~~~~~
> include/cppu/unotype.hxx:325:34: note: in instantiation of member function 'cppu::UnoType<com::sun::star::beans::PropertyValue>::get' requested here
>   325 |     return ::cppu::UnoType< T >::get();
>       |                                  ^
> include/com/sun/star/uno/Sequence.hxx:332:22: note: in instantiation of function template specialization 'cppu::getTypeFavourUnsigned<com::sun::star::beans::PropertyValue>' requested here
>   332 |             (::cppu::getTypeFavourUnsigned(
>       |                      ^
> include/com/sun/star/uno/Sequence.hxx:332:22: note: in instantiation of function template specialization 'cppu::getTypeFavourUnsigned<com::sun::star::beans::PropertyValue>' requested here
> include/com/sun/star/uno/Sequence.hxx:122:38: note: in instantiation of function template specialization 'cppu::getTypeFavourUnsigned<com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>>' requested here
>   122 |         const Type & rType = ::cppu::getTypeFavourUnsigned( static_cast<Sequence const *>(NULL) );
>       |                                      ^
> ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.1/../../../../include/c++/16.0.1/bits/stl_construct.h:88:15: note: in instantiation of member function 'com::sun::star::uno::Sequence<com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>>::~Sequence' requested here
>    88 |         __location->~_Tp();
>       |                      ^

etc. upon seeing the default argument in the declaration of

>     VclBuilder(vcl::Window* pParent, std::u16string_view sUIRootDir, const OUString& sUIFile,
>                OUString sID = {},
>                css::uno::Reference<css::frame::XFrame> xFrame
>                = css::uno::Reference<css::frame::XFrame>(),
>                bool bLegacy = true,
>                std::unique_ptr<NotebookBarAddonsItem> pNotebookBarAddonsItem = nullptr);

in include/vcl/builder.hxx

Change-Id: Id72f7adec9e1e564cdaa14578ddeb1ef052a023b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198184
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-27 09:18:49 +01:00
Stephan Bergmann ad040f7a8f NotebookBarAddonsItem appears to be required to be a complete type here
...contrary to what 96cb87ca01 "tdf#146619 Use
more forward declarations in include/vcl/[a-o]" apparently assumed, as seen at
least with recent Clang 23 trunk against recent libstdc++ 16 trunk,

> In file included from vcl/source/window/builder.cxx:14:
> In file included from ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.1/../../../../include/c++/16.0.1/memory:80:
> ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.1/../../../../include/c++/16.0.1/bits/unique_ptr.h:90:16: error: invalid application of 'sizeof' to an incomplete type 'NotebookBarAddonsItem'
>    90 |         static_assert(sizeof(_Tp)>0,
>       |                       ^~~~~~~~~~~
> ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.1/../../../../include/c++/16.0.1/bits/unique_ptr.h:398:4: note: in instantiation of member function 'std::default_delete<NotebookBarAddonsItem>::operator()' requested here
>   398 |           get_deleter()(std::move(__ptr));
>       |           ^
> include/vcl/builder.hxx:59:80: note: in instantiation of member function 'std::unique_ptr<NotebookBarAddonsItem>::~unique_ptr' requested here
>    59 |                std::unique_ptr<NotebookBarAddonsItem> pNotebookBarAddonsItem = nullptr);
>       |                                                                                ^
> include/vcl/builder.hxx:44:8: note: forward declaration of 'NotebookBarAddonsItem'
>    44 | struct NotebookBarAddonsItem;
>       |        ^

Change-Id: I81537c4c7f774bb1f9e7e3bdbf85af9786c9e016
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198131
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-26 13:39:46 +01:00
Stephan Bergmann bec1cfb664 Even more CppunitTests need the ASan hack now
...from e854abe076 "Avoid external processes
picking up instdir/program/libnspr4.so"

Change-Id: Ifd549cf39cda038c3c6f3ba694bbb6363bc906d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198119
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-26 09:32:48 +01:00
Stephan Bergmann f6dc303ef5 missing include (for USHRT_MAX)
Change-Id: I1f923f34368f06d0d3cfda037b2a607fd364882d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198113
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-26 08:14:08 +01:00
Stephan Bergmann 53e932da93 -Werror,-Wunused-variable
...after 0e7de7e614 "tdf#167883 use
appendTextPortion to construct svx text object"

Change-Id: I3882d6a3852b4e4d30e3406ea5f0b2703afa8f8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198112
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-26 08:13:55 +01:00
Stephan Bergmann 28951381c6 No more need for ReservedId::isInLokIncludeFile special casing
...after 5bc9425900 "Avoid illegal names also for
the LibreOfficeKitGtk structs" removed the remaining offenders

Change-Id: I274486459dfc109c4d2e103d7ec41b0655657e77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198111
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-26 08:13:43 +01:00
Stephan Bergmann 84beb59bb7 Silence spurious -Werror=array-bounds=
seen at least with recent GCC 16 trunk,

> In file included from ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:53,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:82,
>                  from include/unotools/syslocale.hxx:25,
>                  from include/unotools/resmgr.hxx:24,
>                  from xmlsecurity/inc/resourcemanager.hxx:22,
>                  from xmlsecurity/source/component/documentdigitalsignatures.cxx:20:
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = DigitalSignaturesDialog; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = DigitalSignaturesDialog; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_destroy() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:143:9,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = CertificateChooser; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<CertificateChooser>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::security::XCertificate> > {anonymous}::DocumentDigitalSignatures::chooseCertificatesImpl.constprop(SfxViewShell*, std::__debug::map<rtl::OUString, rtl::OUString>&, CertificateChooserUserAction, com::sun::star::security::CertificateKind)’ at xmlsecurity/source/component/documentdigitalsignatures.cxx:674:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<DigitalSignaturesDialog, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [384]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In file included from ~/gcc/inst/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:46,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:67:
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<CertificateChooser, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<CertificateChooser, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_Up> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<CertificateChooser, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<CertificateChooser, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = CertificateChooser; _Alloc = std::allocator<void>; _Args = {weld::Window*&, SfxViewShell*&, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, std::allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*&, SfxViewShell*&, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, std::allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}; _Tp = CertificateChooser; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*&, SfxViewShell*&, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, std::allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}; _Tp = CertificateChooser]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = CertificateChooser; _Args = {weld::Window*&, SfxViewShell*&, __debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘static std::shared_ptr<CertificateChooser> CertificateChooser::getInstance(weld::Window*, SfxViewShell*, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> >&&, CertificateChooserUserAction)’ at xmlsecurity/inc/certificatechooser.hxx:111:113,
>     inlined from ‘com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::security::XCertificate> > {anonymous}::DocumentDigitalSignatures::chooseCertificatesImpl.constprop(SfxViewShell*, std::__debug::map<rtl::OUString, rtl::OUString>&, CertificateChooserUserAction, com::sun::star::security::CertificateKind)’ at xmlsecurity/source/component/documentdigitalsignatures.cxx:664:171:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 384 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = DigitalSignaturesDialog; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_destroy() [with _Tp = DigitalSignaturesDialog; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:684:32,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = CertificateChooser; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<CertificateChooser>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::security::XCertificate> > {anonymous}::DocumentDigitalSignatures::chooseCertificatesImpl.constprop(SfxViewShell*, std::__debug::map<rtl::OUString, rtl::OUString>&, CertificateChooserUserAction, com::sun::star::security::CertificateKind)’ at xmlsecurity/source/component/documentdigitalsignatures.cxx:674:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<DigitalSignaturesDialog, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [384]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<CertificateChooser, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<CertificateChooser, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_Up> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<CertificateChooser, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<CertificateChooser, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = CertificateChooser; _Alloc = std::allocator<void>; _Args = {weld::Window*&, SfxViewShell*&, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, std::allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*&, SfxViewShell*&, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, std::allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}; _Tp = CertificateChooser; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*&, SfxViewShell*&, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, std::allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}; _Tp = CertificateChooser]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = CertificateChooser; _Args = {weld::Window*&, SfxViewShell*&, __debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext>, allocator<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> > >, CertificateChooserUserAction&}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘static std::shared_ptr<CertificateChooser> CertificateChooser::getInstance(weld::Window*, SfxViewShell*, std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> >&&, CertificateChooserUserAction)’ at xmlsecurity/inc/certificatechooser.hxx:111:113,
>     inlined from ‘com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::security::XCertificate> > {anonymous}::DocumentDigitalSignatures::chooseCertificatesImpl.constprop(SfxViewShell*, std::__debug::map<rtl::OUString, rtl::OUString>&, CertificateChooserUserAction, com::sun::star::security::CertificateKind)’ at xmlsecurity/source/component/documentdigitalsignatures.cxx:664:171:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 384 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^

Change-Id: I19ffa8f6d2b7a7c87fe3fbece2eb5e6dc147aa04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197838
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-23 08:05:10 +01:00
Stephan Bergmann 0bdb342a33 Silence spurious -Werror=array-bounds=
seen at least with recent GCC 16 trunk,

> In file included from ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:53,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:82,
>                  from sc/source/filter/inc/workbookhelper.hxx:22,
>                  from sc/source/filter/inc/PivotTableFormat.hxx:12,
>                  from sc/source/filter/oox/PivotTableFormat.cxx:10:
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = ScPatternAttr; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = ScPatternAttr; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_destroy() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:143:9,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = oox::xls::PivotTableReference; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<oox::xls::PivotTableReference>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘oox::xls::PivotTableReference& oox::xls::PivotTableFormat::createReference()’ at sc/source/filter/oox/PivotTableFormat.cxx:128:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<ScPatternAttr, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [120]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In file included from ~/gcc/inst/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:46,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:67:
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_Up> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = oox::xls::PivotTableReference; _Alloc = std::allocator<void>; _Args = {oox::xls::PivotTableFormat&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::PivotTableFormat&}; _Tp = oox::xls::PivotTableReference; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::PivotTableFormat&}; _Tp = oox::xls::PivotTableReference]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = oox::xls::PivotTableReference; _Args = {oox::xls::PivotTableFormat&}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘oox::xls::PivotTableReference& oox::xls::PivotTableFormat::createReference()’ at sc/source/filter/oox/PivotTableFormat.cxx:125:66:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 120 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = ScPatternAttr; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_destroy() [with _Tp = ScPatternAttr; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:684:32,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = oox::xls::PivotTableReference; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<oox::xls::PivotTableReference>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘oox::xls::PivotTableReference& oox::xls::PivotTableFormat::createReference()’ at sc/source/filter/oox/PivotTableFormat.cxx:128:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<ScPatternAttr, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [120]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_Up> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<oox::xls::PivotTableReference, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = oox::xls::PivotTableReference; _Alloc = std::allocator<void>; _Args = {oox::xls::PivotTableFormat&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::PivotTableFormat&}; _Tp = oox::xls::PivotTableReference; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::PivotTableFormat&}; _Tp = oox::xls::PivotTableReference]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = oox::xls::PivotTableReference; _Args = {oox::xls::PivotTableFormat&}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘oox::xls::PivotTableReference& oox::xls::PivotTableFormat::createReference()’ at sc/source/filter/oox/PivotTableFormat.cxx:125:66:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 120 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^

Change-Id: Idfa85dda898dbcd3f5ff86a5b28c0ac3c84c4169
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197836
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-23 08:04:58 +01:00
Stephan Bergmann aa228e60a5 Silence spurious -Werror=maybe-uninitialized
seen at least with recent GCC 16 trunk,

> In file included from unoxml/source/dom/document.hxx:29,
>                  from unoxml/source/dom/document.cxx:22:
> In constructor ‘cppu::ImplInheritanceHelper<BaseClass, Ifc>::ImplInheritanceHelper(Arg&& ...) [with Arg = {DOM::CDocument&, osl::Mutex&, const com::sun::star::xml::dom::NodeType&, _xmlNode*}; BaseClass = DOM::CNode; Ifc = {com::sun::star::xml::dom::XDocument, com::sun::star::xml::dom::events::XDocumentEvent, com::sun::star::io::XActiveDataControl, com::sun::star::io::XActiveDataSource, com::sun::star::xml::sax::XSAXSerializable, com::sun::star::xml::sax::XFastSAXSerializable}]’,
>     inlined from ‘DOM::CDocument::CDocument(xmlDocPtr)’ at unoxml/source/dom/document.cxx:92:58:
> include/cppuhelper/implbase.hxx:152:44: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>   152 |         BaseClass(std::forward<Arg>(arg)...)
>       |                                            ^
> In file included from unoxml/source/dom/document.hxx:50:
> unoxml/inc/node.hxx: In constructor ‘DOM::CDocument::CDocument(xmlDocPtr)’:
> unoxml/inc/node.hxx:110:9: note: by argument 2 of type ‘const DOM::CDocument&’ to ‘DOM::CNode::CNode(const DOM::CDocument&, const osl::Mutex&, const com::sun::star::xml::dom::NodeType&, xmlNode* const&)’ declared here
>   110 |         CNode(CDocument const& rDocument, ::osl::Mutex const& rMutex,
>       |         ^~~~~
> In constructor ‘cppu::ImplInheritanceHelper<BaseClass, Ifc>::ImplInheritanceHelper(Arg&& ...) [with Arg = {DOM::CDocument&, osl::Mutex&, const com::sun::star::xml::dom::NodeType&, _xmlNode*}; BaseClass = DOM::CNode; Ifc = {com::sun::star::xml::dom::XDocument, com::sun::star::xml::dom::events::XDocumentEvent, com::sun::star::io::XActiveDataControl, com::sun::star::io::XActiveDataSource, com::sun::star::xml::sax::XSAXSerializable, com::sun::star::xml::sax::XFastSAXSerializable}]’,
>     inlined from ‘DOM::CDocument::CDocument(xmlDocPtr)’ at unoxml/source/dom/document.cxx:92:58:
> include/cppuhelper/implbase.hxx:152:44: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>   152 |         BaseClass(std::forward<Arg>(arg)...)
>       |                                            ^
> unoxml/inc/node.hxx: In constructor ‘DOM::CDocument::CDocument(xmlDocPtr)’:
> unoxml/inc/node.hxx:110:9: note: by argument 3 of type ‘const osl::Mutex&’ to ‘DOM::CNode::CNode(const DOM::CDocument&, const osl::Mutex&, const com::sun::star::xml::dom::NodeType&, xmlNode* const&)’ declared here
>   110 |         CNode(CDocument const& rDocument, ::osl::Mutex const& rMutex,
>       |         ^~~~~

Change-Id: I9b422727d47b148faf9e7a62ce8220116e32479c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197843
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-23 08:04:47 +01:00
Stephan Bergmann 980612bf2d Silence spurious -Werror=array-bounds=
seen at least with recent GCC 16 trunk,

> In file included from ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:53,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:82,
>                  from include/rtl/stringconcat.hxx:22,
>                  from include/rtl/string.hxx:51,
>                  from include/rtl/ustring.hxx:45,
>                  from include/com/sun/star/uno/Any.h:30,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hdl:6,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/beans/XPropertySet.hdl:9,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/beans/XPropertySet.hpp:6,
>                  from sw/source/uibase/wrtsh/wrtsh1.cxx:20:
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = SwContentControl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = SwContentControl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_destroy() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:143:9,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = weld::MessageDialogController; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<weld::MessageDialogController>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘virtual void SwWrtShell::InfoReadOnlyDialog(bool) const’ at sw/source/uibase/wrtsh/wrtsh1.cxx:2834:5:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<SwContentControl, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [80]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In file included from ~/gcc/inst/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:46,
>                  from ~/gcc/inst/include/c++/16.0.1/string:46,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/locale_classes.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/ios_base.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/ios:46,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/ostream.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/ostream:42,
>                  from include/rtl/ustring.hxx:34:
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<weld::MessageDialogController, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<weld::MessageDialogController, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<weld::MessageDialogController, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<weld::MessageDialogController, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = weld::MessageDialogController; _Alloc = std::allocator<void>; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}; _Tp = weld::MessageDialogController; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}; _Tp = weld::MessageDialogController]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = weld::MessageDialogController; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘virtual void SwWrtShell::InfoReadOnlyDialog(bool) const’ at sw/source/uibase/wrtsh/wrtsh1.cxx:2826:111:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 80 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = SwContentControl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_destroy() [with _Tp = SwContentControl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:684:32,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = weld::MessageDialogController; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<weld::MessageDialogController>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘virtual void SwWrtShell::InfoReadOnlyDialog(bool) const’ at sw/source/uibase/wrtsh/wrtsh1.cxx:2834:5:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<SwContentControl, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [80]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<weld::MessageDialogController, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<weld::MessageDialogController, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<weld::MessageDialogController, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<weld::MessageDialogController, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = weld::MessageDialogController; _Alloc = std::allocator<void>; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}; _Tp = weld::MessageDialogController; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}; _Tp = weld::MessageDialogController]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = weld::MessageDialogController; _Args = {weld::Window*, const char (&)[41], const char (&)[19]}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘virtual void SwWrtShell::InfoReadOnlyDialog(bool) const’ at sw/source/uibase/wrtsh/wrtsh1.cxx:2826:111:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 80 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^

Change-Id: I54717f79621f31061a424fb27204e574b5c7dde1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197841
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-23 08:04:36 +01:00
Stephan Bergmann e3ea377f2d Make a virtual function non-inline
...which helps avoid some supposedly spurious -Werror=free-nonheap-object seen
at least with recent GCC 16 trunk,

> In destructor ‘virtual SvLockBytes::~SvLockBytes()’,
>     inlined from ‘void SvRefBase::ReleaseRef()’ at include/tools/ref.hxx:160:36,
>     inlined from ‘tools::SvRef<T>::~SvRef() [with T = writerfilter::rtftok::RTFTokenizer]’ at include/tools/ref.hxx:56:46,
>     inlined from ‘writerfilter::rtftok::RTFLookahead::~RTFLookahead()’ at sw/source/writerfilter/rtftok/rtflookahead.cxx:37:1:
> include/tools/stream.hxx:115:48: error: ‘void operator delete(void*, std::size_t)’ called on pointer ‘((tools::SvRef<writerfilter::rtftok::RTFTokenizer>*)this)[1].tools::SvRef<writerfilter::rtftok::RTFTokenizer>::pObj’ with nonzero offset 56 [-Werror=free-nonheap-object]
>   115 |     virtual ~SvLockBytes() override { close(); }
>       |                                                ^

etc.

Change-Id: I26a599f0e3258e6bf6a4d6e63e559b41029862db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197842
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-23 08:04:24 +01:00
Stephan Bergmann ae36c06e56 Silence spurious -Werror=array-bounds=
seen at least with recent GCC 16 trunk,

> In file included from ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:53,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:82,
>                  from include/rtl/stringconcat.hxx:22,
>                  from include/rtl/string.hxx:51,
>                  from include/rtl/ustring.hxx:45,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/Exception.hdl:9,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/RuntimeException.hdl:6,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/RuntimeException.hpp:6,
>                  from include/com/sun/star/uno/Reference.hxx:32,
>                  from slideshow/source/inc/shape.hxx:23,
>                  from slideshow/source/inc/box2dtools.hxx:12,
>                  from slideshow/source/engine/box2dtools.cxx:10:
> In destructor ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<b2Body>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘box2d::utils::box2DBody::~box2DBody()’ at slideshow/source/inc/box2dtools.hxx:333:7,
>     inlined from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = box2d::utils::box2DBody]’ at ~/gcc/inst/include/c++/16.0.1/bits/stl_construct.h:88:18,
>     inlined from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = box2d::utils::box2DBody]’ at ~/gcc/inst/include/c++/16.0.1/bits/stl_construct.h:164:22,
>     inlined from ‘static constexpr void std::allocator_traits<std::allocator<void> >::destroy(allocator_type&, _Up*) [with _Up = box2d::utils::box2DBody]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:819:17,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_dispose() [with _Tp = box2d::utils::box2DBody; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:675:35,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:423:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<b2Body>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:731:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1128:13: error: array subscript 3 is outside array bounds of ‘std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic> [1]’ [-Werror=array-bounds=]
>  1128 |         if (_M_pi != nullptr)
>       |             ^~~~~
> In file included from ~/gcc/inst/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:46,
>                  from ~/gcc/inst/include/c++/16.0.1/string:46,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/locale_classes.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/ios_base.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/ios:46,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/ostream.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/ostream:42,
>                  from include/com/sun/star/uno/Reference.hxx:29:
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter, _Alloc) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; _Alloc = std::allocator<void>; <template-parameter-2-4> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1007:13,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:996:57,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1557:17,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:231:48,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:669:6:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: at offset 24 into object of size 24 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘box2d::utils::box2DBody::~box2DBody()’,
>     inlined from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = box2d::utils::box2DBody]’ at ~/gcc/inst/include/c++/16.0.1/bits/stl_construct.h:88:18,
>     inlined from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = box2d::utils::box2DBody]’ at ~/gcc/inst/include/c++/16.0.1/bits/stl_construct.h:164:22,
>     inlined from ‘static constexpr void std::allocator_traits<std::allocator<void> >::destroy(allocator_type&, _Up*) [with _Up = box2d::utils::box2DBody]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:819:17,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_dispose() [with _Tp = box2d::utils::box2DBody; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:675:35,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:423:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<b2Body>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:731:1:
> slideshow/source/inc/box2dtools.hxx:333:7: error: array subscript ‘box2d::utils::box2DBody[0]’ is partly outside array bounds of ‘unsigned char [24]’ [-Werror=array-bounds=]
>   333 | class box2DBody
>       |       ^~~~~~~~~
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter, _Alloc) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; _Alloc = std::allocator<void>; <template-parameter-2-4> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1007:13,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:996:57,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1557:17,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:231:48,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:669:6:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: at offset 16 into object of size 24 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = box2d::utils::box2DBody; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = box2d::utils::box2DBody; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_destroy() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:143:9,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<b2Body>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:731:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<box2d::utils::box2DBody, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [24]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter, _Alloc) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; _Alloc = std::allocator<void>; <template-parameter-2-4> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1007:13,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:996:57,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1557:17,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:231:48,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:669:6:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 24 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = box2d::utils::box2DBody; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_destroy() [with _Tp = box2d::utils::box2DBody; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:684:32,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<b2Body>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:731:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<box2d::utils::box2DBody, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [24]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_deleter<b2Body*, box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter, _Alloc) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; _Alloc = std::allocator<void>; <template-parameter-2-4> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1007:13,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter) [with _Ptr = b2Body*; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:996:57,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1557:17,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter) [with _Yp = b2Body; _Deleter = box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)::<lambda(b2Body*)>; <template-parameter-2-3> = void; _Tp = b2Body]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:231:48,
>     inlined from ‘box2d::utils::Box2DBodySharedPtr box2d::utils::box2DWorld::createStaticBody(const slideshow::internal::ShapeSharedPtr&)’ at slideshow/source/engine/box2dtools.cxx:669:6:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 24 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^

Change-Id: I437410fb3ca777405f8153c13c3e3cc47bc6e8b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197839
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 22:49:58 +01:00
Stephan Bergmann 3e9763c0ae -Werror=maybe-uninitialized
> xmloff/source/text/txtimppr.cxx:615:9: error: ‘nVertOrient’ may be used uninitialized [-Werror=maybe-uninitialized]
>   615 |         switch( nVertOrient )
>       |         ^~~~~~

So use the same approach for nVertOrient as was already used for nVertOrientRel
in 7ab4c76e73 "INTEGRATION: CWS warningfixes02
(1.18.10); FILE MERGED", initializing it to 0 aka css.text.VertOrientation.NONE.

Change-Id: Ibf9b259f87fb030e426664bc3bbd63fc1bfb0797
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197832
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 22:49:46 +01:00
Stephan Bergmann 446f995f86 Silence spurious -Werror=uninitialized and -Werror=maybe-uninitialized
seen at least with recent GCC 16 trunk,

> In file included from sw/inc/swatrset.hxx:22,
>                  from sw/inc/format.hxx:27,
>                  from sw/inc/fchrfmt.hxx:23,
>                  from sw/inc/txatbase.hxx:33,
>                  from sw/inc/txtfld.hxx:22,
>                  from sw/source/core/txtnode/atrfld.cxx:25:
> In member function ‘SfxPoolItemHolder::operator bool() const’,
>     inlined from ‘const SfxPoolItem& SwTextAttr::GetAttr() const’ at sw/inc/txatbase.hxx:175:5,
>     inlined from ‘SfxPoolItem& SwTextAttr::GetAttr()’ at sw/inc/txatbase.hxx:181:65,
>     inlined from ‘SwTextField::SwTextField(const SfxPoolItemHolder&, sal_Int32, bool)’ at sw/source/core/txtnode/atrfld.cxx:603:70:
> include/svl/itemset.hxx:72:56: error: ‘*(const SfxPoolItemHolder*)((char*)<unknown> + 8).SfxPoolItemHolder::m_pItem’ is used uninitialized [-Werror=uninitialized]
>    72 |     explicit operator bool() const { return nullptr != m_pItem; }
>       |                                                        ^~~~~~~
> In member function ‘bool SfxPoolItemHolder::isDeleted() const’,
>     inlined from ‘const SfxPoolItem* SfxPoolItemHolder::getItem() const’ at include/svl/itemset.hxx:69:42,
>     inlined from ‘const SfxPoolItem& SwTextAttr::GetAttr() const’ at sw/inc/txatbase.hxx:176:28,
>     inlined from ‘SfxPoolItem& SwTextAttr::GetAttr()’ at sw/inc/txatbase.hxx:181:65,
>     inlined from ‘SwTextField::SwTextField(const SfxPoolItemHolder&, sal_Int32, bool)’ at sw/source/core/txtnode/atrfld.cxx:603:70:
> include/svl/itemset.hxx:62:37: error: ‘*(const SfxPoolItemHolder*)((char*)<unknown> + 8).SfxPoolItemHolder::m_bDeleted’ may be used uninitialized [-Werror=maybe-uninitialized]
>    62 |     bool isDeleted() const { return m_bDeleted; }
>       |                                     ^~~~~~~~~~

Change-Id: Id02928cf69afa850f97fe3f1eff958055f2a9302
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197840
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-22 22:49:32 +01:00
Stephan Bergmann 713e048c23 Silence spurious -Werror=array-bounds=
seen at least with recent GCC 16 trunk,

> In file included from ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:53,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:82,
>                  from include/oox/helper/refvector.hxx:25,
>                  from sc/source/filter/inc/tablecolumnsbuffer.hxx:22,
>                  from sc/source/filter/oox/tablecolumnsbuffer.cxx:20:
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = oox::xls::TableColumns; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = oox::xls::TableColumns; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_destroy() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:143:9,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = oox::xls::TableColumn; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<oox::xls::TableColumn>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘oox::xls::TableColumn& oox::xls::TableColumns::createTableColumn()’ at sc/source/filter/oox/tablecolumnsbuffer.cxx:110:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<oox::xls::TableColumns, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [80]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In file included from ~/gcc/inst/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:46,
>                  from ~/gcc/inst/include/c++/16.0.1/string:46,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/stdexcept_throw.h:57,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/hashtable_policy.h:35,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/hashtable.h:37,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/unordered_map.h:33,
>                  from ~/gcc/inst/include/c++/16.0.1/unordered_map:43,
>                  from ~/gcc/inst/include/c++/16.0.1/functional:80,
>                  from include/oox/helper/refvector.hxx:24:
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::TableColumn, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::TableColumn, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::TableColumn, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<oox::xls::TableColumn, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = oox::xls::TableColumn; _Alloc = std::allocator<void>; _Args = {oox::xls::TableColumns&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::TableColumns&}; _Tp = oox::xls::TableColumn; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::TableColumns&}; _Tp = oox::xls::TableColumn]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = oox::xls::TableColumn; _Args = {oox::xls::TableColumns&}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘oox::xls::TableColumn& oox::xls::TableColumns::createTableColumn()’ at sc/source/filter/oox/tablecolumnsbuffer.cxx:107:87:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 80 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = oox::xls::TableColumns; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_destroy() [with _Tp = oox::xls::TableColumns; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:684:32,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = oox::xls::TableColumn; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<oox::xls::TableColumn>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘oox::xls::TableColumn& oox::xls::TableColumns::createTableColumn()’ at sc/source/filter/oox/tablecolumnsbuffer.cxx:110:1:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<oox::xls::TableColumns, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [80]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::TableColumn, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::TableColumn, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<oox::xls::TableColumn, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<oox::xls::TableColumn, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = oox::xls::TableColumn; _Alloc = std::allocator<void>; _Args = {oox::xls::TableColumns&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::TableColumns&}; _Tp = oox::xls::TableColumn; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {oox::xls::TableColumns&}; _Tp = oox::xls::TableColumn]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = oox::xls::TableColumn; _Args = {oox::xls::TableColumns&}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘oox::xls::TableColumn& oox::xls::TableColumns::createTableColumn()’ at sc/source/filter/oox/tablecolumnsbuffer.cxx:107:87:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 80 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^

Change-Id: I5f42c82dba453bd656fc16173a08d19d61186bbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197837
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 22:49:18 +01:00
Stephan Bergmann 2399414291 -Werror=maybe-uninitialized
Change-Id: I0933c67f66513eb6a16b4d3ecb35eec761f452bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197835
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 22:49:03 +01:00
Stephan Bergmann 0360f4d2d2 Silence spurious -Werror=array-bounds=
seen at least with recent GCC 16 trunk,

> In file included from ~/gcc/inst/include/c++/16.0.1/bits/char_traits.h:59,
>                  from ~/gcc/inst/include/c++/16.0.1/ios:44,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/ostream.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/ostream:42,
>                  from include/rtl/ustring.hxx:34,
>                  from include/com/sun/star/uno/Any.h:30,
>                  from include/cppuhelper/implbase_ex.hxx:26,
>                  from include/cppuhelper/implbase5.hxx:26,
>                  from dbaccess/source/core/inc/querycontainer.hxx:22,
>                  from dbaccess/source/core/api/querycontainer.cxx:20:
> In function ‘constexpr void std::destroy_at(_Tp*) [with _Tp = dbaccess::ODefinitionContainer_Impl]’,
>     inlined from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = dbaccess::ODefinitionContainer_Impl]’ at ~/gcc/inst/include/c++/16.0.1/bits/stl_construct.h:164:22,
>     inlined from ‘static constexpr void std::allocator_traits<std::allocator<void> >::destroy(allocator_type&, _Up*) [with _Up = dbaccess::ODefinitionContainer_Impl]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:819:17,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_dispose() [with _Tp = dbaccess::ODefinitionContainer_Impl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:675:35,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:423:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = dbaccess::IContainerApprove; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<dbaccess::IContainerApprove>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘void dbaccess::OQueryContainer::init()’ at dbaccess/source/core/api/querycontainer.cxx:87:61:
> ~/gcc/inst/include/c++/16.0.1/bits/stl_construct.h:88:25: error: array subscript ‘dbaccess::ODefinitionContainer_Impl[0]’ is partly outside array bounds of ‘unsigned char [40]’ [-Werror=array-bounds=]
>    88 |         __location->~_Tp();
>       |         ~~~~~~~~~~~~~~~~^~
> In file included from ~/gcc/inst/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:46,
>                  from ~/gcc/inst/include/c++/16.0.1/string:46,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/locale_classes.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/bits/ios_base.h:43,
>                  from ~/gcc/inst/include/c++/16.0.1/ios:46:
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = dbaccess::ObjectNameApproval; _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; _Tp = dbaccess::ObjectNameApproval; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; _Tp = dbaccess::ObjectNameApproval]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = dbaccess::ObjectNameApproval; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘void dbaccess::OQueryContainer::init()’ at dbaccess/source/core/api/querycontainer.cxx:87:61:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: at offset 16 into object of size 40 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In file included from ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:53,
>                  from ~/gcc/inst/include/c++/16.0.1/memory:82,
>                  from include/rtl/stringconcat.hxx:22,
>                  from include/rtl/string.hxx:51,
>                  from include/rtl/ustring.hxx:45:
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = dbaccess::ODefinitionContainer_Impl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = dbaccess::ODefinitionContainer_Impl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_destroy() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:143:9,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = dbaccess::IContainerApprove; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<dbaccess::IContainerApprove>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘void dbaccess::OQueryContainer::init()’ at dbaccess/source/core/api/querycontainer.cxx:87:61:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<dbaccess::ODefinitionContainer_Impl, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [40]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = dbaccess::ObjectNameApproval; _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; _Tp = dbaccess::ObjectNameApproval; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; _Tp = dbaccess::ObjectNameApproval]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = dbaccess::ObjectNameApproval; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘void dbaccess::OQueryContainer::init()’ at dbaccess/source/core/api/querycontainer.cxx:87:61:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 40 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^
> In destructor ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::~_Sp_counted_ptr_inplace() [with _Tp = dbaccess::ODefinitionContainer_Impl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
>     inlined from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_destroy() [with _Tp = dbaccess::ODefinitionContainer_Impl; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:684:32,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:424:18,
>     inlined from ‘void std::_Sp_counted_base<_Lp>::_M_release() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:392:5,
>     inlined from ‘std::__shared_count<_Lp>::~__shared_count() [with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1129:21,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::~__shared_ptr() [with _Tp = dbaccess::IContainerApprove; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1603:7,
>     inlined from ‘std::shared_ptr<dbaccess::IContainerApprove>::~shared_ptr()’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:175:11,
>     inlined from ‘void dbaccess::OQueryContainer::init()’ at dbaccess/source/core/api/querycontainer.cxx:87:61:
> ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:670:45: error: array subscript ‘std::_Sp_counted_ptr_inplace<dbaccess::ODefinitionContainer_Impl, std::allocator<void>, __gnu_cxx::_S_atomic>[0]’ is partly outside array bounds of ‘unsigned char [40]’ [-Werror=array-bounds=]
>   670 |       ~_Sp_counted_ptr_inplace() noexcept { }
>       |                                             ^
> In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’,
>     inlined from ‘constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocator.h:203:40,
>     inlined from ‘static constexpr _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, std::allocator<void>, __gnu_cxx::_S_atomic>]’ at ~/gcc/inst/include/c++/16.0.1/bits/alloc_traits.h:614:28,
>     inlined from ‘std::__allocated_ptr<_Alloc> std::__allocate_guarded(_Alloc&) [with _Alloc = allocator<_Sp_counted_ptr_inplace<dbaccess::ObjectNameApproval, allocator<void>, __gnu_cxx::_S_atomic> >]’ at ~/gcc/inst/include/c++/16.0.1/bits/allocated_ptr.h:103:69,
>     inlined from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = dbaccess::ObjectNameApproval; _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1027:9,
>     inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; _Tp = dbaccess::ObjectNameApproval; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr_base.h:1805:14,
>     inlined from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}; _Tp = dbaccess::ObjectNameApproval]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:463:59,
>     inlined from ‘std::shared_ptr<std::_NonArray<_Tp> > std::make_shared(_Args&& ...) [with _Tp = dbaccess::ObjectNameApproval; _Args = {com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&, dbaccess::ObjectNameApproval::ObjectType}]’ at ~/gcc/inst/include/c++/16.0.1/bits/shared_ptr.h:1066:39,
>     inlined from ‘void dbaccess::OQueryContainer::init()’ at dbaccess/source/core/api/querycontainer.cxx:87:61:
> ~/gcc/inst/include/c++/16.0.1/bits/new_allocator.h:151:73: note: object of size 40 allocated by ‘operator new’
>   151 |     return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
>       |                                                                     ^

Change-Id: I089a58793649d892e88b7e3632c8b61f89b0a60c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197834
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 22:48:48 +01:00
Stephan Bergmann 56a43e0966 Silence spurious -Werror=array-bounds=
seen at least with recent GCC 16 trunk,

> In member function ‘virtual void SbModule::SetParent(SbxObject*)’,
>     inlined from ‘virtual SbxVariable* SbModule::Find(const rtl::OUString&, SbxClassType)’ at basic/source/classes/sbxmod.cxx:653:36:
> basic/source/classes/sbxmod.cxx:671:13: error: array subscript ‘SbModule[0]’ is partly outside array bounds of ‘unsigned char [152]’ [-Werror=array-bounds=]
>   671 |     pParent = p;
>       |     ~~~~~~~~^~~
> basic/source/classes/sbxmod.cxx: In member function ‘virtual SbxVariable* SbModule::Find(const rtl::OUString&, SbxClassType)’:
> basic/source/classes/sbxmod.cxx:651:55: note: object of size 152 allocated by ‘operator new’
>   651 |                     pRes = new SbxVariable( SbxOBJECT );
>       |                                                       ^

Change-Id: I0823b28063b6e224f9cc28aee55fd21e2f21aa1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197833
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 22:48:32 +01:00
Stephan Bergmann 8fb5be18f8 Use OStringBuffer as a pad for the mutable string passed to mkstemp
...by introducing OStringBuffer::getMutableStr and (for consistency)
OUStringBuffer::getMutableStr

Change-Id: I4dfc3b8d8ffb49b8b3742600081d075536b312e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197605
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-20 07:33:22 +01:00
Stephan Bergmann 25b197e063 missing includes
Change-Id: Iaab5ac2575e5b4b4365148fa3c9c645e7f4836e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-14 10:53:45 +01:00
Stephan Bergmann 47a8c139a4 external/poppler: missing includes (for INT_MAX etc.)
Change-Id: I7189b126b335a70e045adb46676c3271f6a113cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197236
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-14 09:20:28 +01:00
Stephan Bergmann 64c0efa33f Don't consider semantics for three-segment bootstrap var refs erroneous
I had added that comment back in 4a415c4c5a
"INTEGRATION: CWS sb83 (1.39.26); FILE MERGED", but on second thought, it might
be better to consider a three-segment botostrap variable reference of the form
${file:section:key} (which are hardly used anywhere, if at all, anyway) to do
something special:  It reads the "'osl' profile" <file> and uses the value (if
any) for the given <section> and <key>, without expanding it any further, by
design.

That's in line with what the documentation in OOo's CVS
udk/www/common/man/concept/uno_default_bootstrapping.html said,

>                                 <li>
>                                 Allow indirect expansion of variables through 'osl' profiles:
>                                 <br/>
>                                 KEYVALUE=${sversionrc:versions:StarOffice6.0}
>                                 <br/>
>                                 The first part of the indirection is the file to use for
>                                 expansion, the second part is
>                                 the section and the third part is the key. After expansion the
>                                 variable KEYVALUE has
>                                 the value of the matching key of the sversionrc.
>                                 </li>

and what the original code in OOo's CVS porting/sal/rtl/source/macro.cxx
ArgParserState::expandTerm did,

>                 // do we have a section?
>                 OUString value;
>                 if (section.getLength())
>                 {
>                         // expand from profile
>                         oslProfile hProfile;
[...]
>                 }
>                 else
>                 {
>                         // expand from ini:

And it's also in line with the documentation in include/rtl/bootstrap.h stating

>    An ini-file is only allowed to have one section, which must be named
>    `[Bootstrap]` with the square brackets.
>    The section may be omitted.

Which implies that the <file> in a ${file:section:key} reference is not actually
a bootstrap ini-file (but rather an "'osl' profile"), because those bootstrap
ini-files should not have multiple sections anyway.

Change-Id: Iaf6e97a61fe5a4a330451794a62067b4add20a05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196674
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-07 17:19:19 +01:00
Stephan Bergmann 1ffc2b44e4 Actually use "..."_tstr
...after 6fce450b8a "Introduce "..."_tstr as a
companion to "..."_ostr/u"..."_ustr in template code" had introduced it for
exactly this piece of code

Change-Id: I767a9f39456d6c58c5ac0478110a0c66434b0e54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196626
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-07 08:06:21 +01:00
Stephan Bergmann b0f189160c Prevent int vs. sal_Int32 mismatch
...as caused build issues for e.g. 32-bit Wasm

Change-Id: Iec2964dd73b29cca8b1acbe297cdf0aee27cf77a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196620
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-06 22:13:48 +01:00
Stephan Bergmann 019b8338fb missing include
Change-Id: I2002b4219375f461ab6cdbf28228a9510516bf4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196619
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-06 20:54:02 +01:00
Stephan Bergmann 88b9ea790b We can use the "official" typedef names here
no need to mess with the illegally-named struct types directly

Change-Id: If5e6e7b725cb4904c269312b1b172c9f9911dfb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196590
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-06 10:13:01 +01:00
Stephan Bergmann a8156c8167 loplugin:unreffun
Change-Id: I81be1facce17a2516000884ceb8c84620e52c31a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196574
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-06 08:06:19 +01:00
Stephan Bergmann 70038dfcb3 missing include
Change-Id: Icf0eb4943596d33f632d2209cb955ebbc3434e72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196573
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-06 08:06:00 +01:00
Stephan Bergmann 030d1a13a1 -Werror=unused-but-set-variable
...after c184cd9848 "tdf#168594 tdf#119931 a11y
special chars: Use IconView for recent/favorites"

Change-Id: I79d63bc80548419b1170b2a2cd25a99f08341907
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196528
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-05 09:41:01 +01:00
Stephan Bergmann 09cfff610b UBSan apparently needs ScDataPilotFieldsObj RTTI now
...seeing CppunitTest_sc_filters_test failing with

> DynamicLibraryManagerException: "Failed to load dynamic library: /home/sberg/lo/core/workdir/LinkTarget/CppunitTest/libtest_sc_filters_test.so
> /home/sberg/lo/core/instdir/program/libscfiltlo.so: undefined symbol: _ZTI20ScDataPilotFieldsObj"

Change-Id: I787e116dc3ae1249ac8377767e49d0cbcd9ec2db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196266
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-28 18:03:37 +01:00
Stephan Bergmann 902ab630e9 external/python3: Silence more UBSan "applying zero offset to null pointer"
...following up further on 2b86e8b371
"external/python3: Silence more UBSan 'applying zero offset to null pointer'",
now for <https://ci.libreoffice.org/job/lo_ubsan/3758/>

Change-Id: Iff836059cb822fbb26d9bd8aba018bd60aaac71f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195911
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-22 16:20:17 +01:00
Stephan Bergmann 2b86e8b371 external/python3: Silence more UBSan "applying zero offset to null pointer"
> Objects/listobject.c:1370:37: runtime error: applying zero offset to null pointer
>     #0 0x7f38b863523a in list_extend_dictitems /workdir/UnpackedTarball/python3/Objects/listobject.c:1370:37
>     #1 0x7f38b862a555 in _list_extend /workdir/UnpackedTarball/python3/Objects/listobject.c:1435:15
>     #2 0x7f38b8651977 in list___init___impl /workdir/UnpackedTarball/python3/Objects/listobject.c:3467:13
>     #3 0x7f38b86305d3 in list_vectorcall /workdir/UnpackedTarball/python3/Objects/listobject.c:3491:13
[...]

as seen while building workdir/XcuFilterFiltersTarget/fcfg_impress_filters.xcu
etc. at <https://ci.libreoffice.org/job/lo_ubsan/3756/>.

(Same as 314c4b5ef949f5bb1a4f13048726c440e556ba67 "external/python3: Silence
UBSan 'applying zero offset to null pointer'", this only gets reported with old
Clang prior to Clang 20
<https://github.com/llvm/llvm-project/commit/4847395c5459f9c476808f9337abdae7fbd78a23>
"[Clang] Adjust pointer-overflow sanitizer for N3322 (#120719)".)

Change-Id: I15129f5fa3eb3c0f92d6e3a80f914f63e12efdb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195894
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-19 15:19:03 +01:00
Stephan Bergmann a1f71ce7aa Fix loplugin:unusedcapturedefault for lambdas in template code
...as found failing at <https://gerrit.libreoffice.org/c/core/+/195869/1>
"tdf#165233 Replaced lambda explicit capture with capture-default".

The lambda class in f3 in compilerplugins/clang/test/unusedcapturedefault.cxx is

> CXXRecordDecl 0x42964240 </home/sberg/lo/core/compilerplugins/clang/test/unusedcapturedefault.cxx:25:12> col:12 implicit class definition
> |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
> | |-DefaultConstructor defaulted_is_constexpr
> | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
> | |-MoveConstructor exists simple trivial needs_implicit
> | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
> | |-MoveAssignment
> | `-Destructor simple irrelevant trivial constexpr needs_implicit
> `-CXXMethodDecl 0x42964380 <col:16, col:30> col:12 operator() 'auto () const' inline
>   `-CompoundStmt 0x429644f0 <col:18, col:30>
>     `-ReturnStmt 0x429644e0 <col:20, col:27>
>       `-DeclRefExpr 0x429644c0 <col:27> 'const T' lvalue ParmVar 0x42963ec8 'x' 'T' refers_to_enclosing_variable_or_capture

without any FieldDecls.

Change-Id: I57bbb8ae3e052d3e00644228b83612e06ab37a0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195879
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-19 13:04:13 +01:00
Stephan Bergmann 957040675c external/python3: Silence UBSan "applying zero offset to null pointer"
> Objects/listobject.c:1328:37: runtime error: applying zero offset to null pointer
>     #0 0x55b0a0534264 in list_extend_set /workdir/UnpackedTarball/python3/Objects/listobject.c:1328:37
>     #1 0x55b0a052a015 in _list_extend /workdir/UnpackedTarball/python3/Objects/listobject.c:1412:15
>     #2 0x55b0a0529e7c in list_extend /workdir/UnpackedTarball/python3/Objects/listobject.c:1459:9
>     #3 0x55b0a0529e4c in _PyList_Extend /workdir/UnpackedTarball/python3/Objects/listobject.c:1468:12
>     #4 0x55b0a038fc84 in PySequence_List /workdir/UnpackedTarball/python3/Objects/abstract.c:2135:10
>     #5 0x55b0a0c8b648 in compiler_class_body /workdir/UnpackedTarball/python3/Python/compile.c:2554:44
>     #6 0x55b0a0c4f1e8 in compiler_class /workdir/UnpackedTarball/python3/Python/compile.c:2674:9
>     #7 0x55b0a0c42d62 in compiler_visit_stmt /workdir/UnpackedTarball/python3/Python/compile.c:4053:16
>     #8 0x55b0a0c3fde2 in compiler_body /workdir/UnpackedTarball/python3/Python/compile.c:1684:9
>     #9 0x55b0a0c300c7 in compiler_codegen /workdir/UnpackedTarball/python3/Python/compile.c:1695:13
>     #10 0x55b0a0c2b68d in compiler_mod /workdir/UnpackedTarball/python3/Python/compile.c:1736:9
>     #11 0x55b0a0c2b460 in _PyAST_Compile /workdir/UnpackedTarball/python3/Python/compile.c:452:24
>     #12 0x55b0a0f9145d in Py_CompileStringObject /workdir/UnpackedTarball/python3/Python/pythonrun.c:1563:10
>     #13 0x55b0a0f914ee in Py_CompileStringExFlags /workdir/UnpackedTarball/python3/Python/pythonrun.c:1576:10
>     #14 0x55b09fe074cc in compile_and_marshal /workdir/UnpackedTarball/python3/Programs/_freeze_module.c:117:22
>     #15 0x55b09fe068ac in main /workdir/UnpackedTarball/python3/Programs/_freeze_module.c:230:28
>     #16 0x7fa25722a60f in __libc_start_call_main (/lib64/libc.so.6+0x2a60f) (BuildId: e650335ac8463e9e58c04e07c6f36c5f826ed953)
>     #17 0x7fa25722a6bf in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a6bf) (BuildId: e650335ac8463e9e58c04e07c6f36c5f826ed953)
>     #18 0x55b09fcc70f4 in _start (/workdir/UnpackedTarball/python3/Programs/_freeze_module+0xb050f4)

as seen while building ExternalProject_python3 at
<https://ci.libreoffice.org/job/lo_ubsan/3755/>, presumably since
241826dcb9 "python3: upgrade to 3.13.11 (master
only)"

Change-Id: I981820da8cf7e99e04e01fce8add7574d6f20ab7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195840
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-18 15:45:42 +01:00
Stephan Bergmann cf49d618f4 Use direct PyUNO calls in PythonTest_pyuno_pytests_embindtest
...after 507b6c2b90 "tdf#169229: pyuno: Allow Any
when calling a method"

Change-Id: Ie91781abce253aece201605d0930344ddf8d1256
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195842
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-18 15:45:25 +01:00
Stephan Bergmann 1896d58849 -Werror,-Wunused-variable
...after c60be14f9c "SmartArt: Move Information
from GrabBag to DiagramHelper"

Change-Id: I1b437c0c85d9736fd1c17ebd08366fea5bcbffb5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195835
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-18 15:45:04 +01:00
Stephan Bergmann fdf541b6db Give PythonTest_pyuno_pytests_embindtest test coverage on some CI builds
...namely the Gerrit
<https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/> and the daily
<https://ci.libreoffice.org/job/lo_ubsan/>.
(PythonTest_pyuno_pytests_embindtest got recently introduced in
3320b5fe2e "Add exhaustive testing of PyUNO type
mapping based on embindtest" and is conditional on --enable-embindtest-uno.)

Change-Id: I4f8af757bf1b605c0d0cfec29da94a6ecf63f1f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195830
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-18 12:55:31 +01:00
Stephan Bergmann 28cd273a75 Reapply external/python3/ubsan.patch.0 hunk
...that 241826dcb9 "python3: upgrade to 3.13.11
(master only)" had simply dropped, but which is still necessary to silence
pointer-overflow issues as discussed in the commit message of
fcaef01faf "external/python3: Silence
pointer-overflow" (now, it caused e.g.

> [FIO] fcfg_database_others.xcu
> Parser/lexer/buffer.c:30:41: runtime error: pointer index expression with base 0x7d8e21edb920 overflowed to 0xfffffffffffe2000
>  #0 in _PyLexer_restore_fstring_buffers at workdir/UnpackedTarball/python3/Parser/lexer/buffer.c:30:41
>  #1 in _PyLexer_tok_reserve_buf at workdir/UnpackedTarball/python3/Parser/lexer/buffer.c:73:9
>  #2 in tok_readline_raw at workdir/UnpackedTarball/python3/Parser/tokenizer/file_tokenizer.c:59:14
[...]

to fail during the build)

Change-Id: Ib91feb446f6dfcbe3e60b8e3b54ac6503546ddda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195773
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-17 15:01:57 +01:00
Stephan Bergmann dac27e9967 Guard against mpAssociatedSdrObjGroup->mp_DiagramHelper.reset() deleting *this
(whether or not that's actually intended to happen; i.e., maybe this just fixes
a symptom and not the cause)

CppunitTest_sd_export_tests-ooxml2 started to fail with

> ==3826659==ERROR: AddressSanitizer: heap-use-after-free on address 0x7b91d094e0b0 at pc 0x7b315d113da8 bp 0x7fffa8477530 sp 0x7fffa8477528
> WRITE of size 8 at 0x7b91d094e0b0 thread T0
>  #0 in svx::diagram::IDiagramHelper::disconnectFromSdrObjGroup() at svx/source/diagram/IDiagramHelper.cxx:427:33
>  #1 in testSmartartRotation2::TestBody() at sd/qa/unit/export-tests-ooxml2.cxx:1606:39
>
> 0x7b91d094e0b0 is located 16 bytes inside of 64-byte region [0x7b91d094e0a0,0x7b91d094e0e0)
> freed by thread T0 here:
>  #0 in operator delete(void*, unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:190:3
>  #1 in oox::drawingml::AdvancedDiagramHelper::~AdvancedDiagramHelper() at oox/source/drawingml/diagram/diagramhelper.cxx:56:1
>  #2 in std::_Sp_counted_ptr<svx::diagram::IDiagramHelper*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/bits/shared_ptr_base.h:487:9
>  #3 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/bits/shared_ptr_base.h:423:8
>  #4 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/bits/shared_ptr_base.h:1129:11
>  #5 in std::__shared_ptr<svx::diagram::IDiagramHelper, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/bits/shared_ptr_base.h:1603:31
>  #6 in std::__shared_ptr<svx::diagram::IDiagramHelper, (__gnu_cxx::_Lock_policy)2>::reset() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/bits/shared_ptr_base.h:1721:9
>  #7 in svx::diagram::IDiagramHelper::disconnectFromSdrObjGroup() at svx/source/diagram/IDiagramHelper.cxx:426:51
>  #8 in testSmartartRotation2::TestBody() at sd/qa/unit/export-tests-ooxml2.cxx:1606:39
>
> previously allocated by thread T0 here:
>  #0 in operator new(unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:109:35
>  #1 in oox::drawingml::Shape::prepareDiagramHelper(std::shared_ptr<oox::drawingml::Diagram> const&, std::shared_ptr<oox::drawingml::Theme> const&, bool) at oox/source/drawingml/shape.cxx:267:27
>  #2 in oox::drawingml::loadDiagram(std::shared_ptr<oox::drawingml::Shape> const&, oox::core::XmlFilterBase&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, oox::core::Relations const&) at oox/source/drawingml/diagram/diagram.cxx:443:17
>  #3 in oox::drawingml::DiagramGraphicDataContext::onCreateContext(int, oox::AttributeList const&) at oox/source/drawingml/graphicshapecontext.cxx:294:9
>  #4 in non-virtual thunk to oox::drawingml::DiagramGraphicDataContext::onCreateContext(int, oox::AttributeList const&) at oox/source/drawingml/graphicshapecontext.cxx
>  #5 in oox::core::ContextHandler2Helper::implCreateChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at oox/source/core/contexthandler2.cxx:99:34
>  #6 in oox::core::ContextHandler2::createFastChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at oox/source/core/contexthandler2.cxx:203:12
>  #7 in non-virtual thunk to oox::core::ContextHandler2::createFastChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) at oox/source/core/contexthandler2.cxx
>  #8 in (anonymous namespace)::Entity::startElement((anonymous namespace)::Event const*) at sax/source/fastparser/fastparser.cxx:468:44
>  #9 in sax_fastparser::FastSaxParserImpl::callbackStartElement(unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, unsigned char const**) at sax/source/fastparser/fastparser.cxx:1304:21
>  #10 in (anonymous namespace)::call_callbackStartElement(void*, unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, int, unsigned char const**) at sax/source/fastparser/fastparser.cxx:336:18
>  #11 in xmlParseStartTag2 at workdir/UnpackedTarball/libxml2/parser.c:9568:6
>  #12 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11217:14
>  #13 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:11553:5
>  #14 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1094:21
>  #15 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:898:9
>  #16 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1492:13
>  #17 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) at oox/source/core/fastparser.cxx:121:15
>  #18 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) at oox/source/core/fastparser.cxx:129:5
>  #19 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) at oox/source/core/xmlfilterbase.cxx:427:21
>  #20 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) at oox/source/core/xmlfilterbase.cxx:357:12
>  #21 in oox::ppt::PresentationFragmentHandler::importSlide(rtl::Reference<oox::core::FragmentHandler> const&, std::shared_ptr<oox::ppt::SlidePersist> const&) at oox/source/ppt/presentationfragmenthandler.cxx:843:17
>  #22 in oox::ppt::PresentationFragmentHandler::importSlide(unsigned int, bool, bool) at oox/source/ppt/presentationfragmenthandler.cxx:503:13
>  #23 in oox::ppt::PresentationFragmentHandler::finalizeImport() at oox/source/ppt/presentationfragmenthandler.cxx:652:17
>  #24 in oox::core::FragmentHandler2::endDocument() at oox/source/core/fragmenthandler2.cxx:53:5
>  #25 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:904:36
>  #26 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1492:13
>  #27 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) at oox/source/core/fastparser.cxx:121:15
>  #28 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) at oox/source/core/fastparser.cxx:129:5
>  #29 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) at oox/source/core/xmlfilterbase.cxx:427:21
>  #30 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) at oox/source/core/xmlfilterbase.cxx:357:12
>  #31 in oox::ppt::PowerPointImport::importDocument() at oox/source/ppt/pptimport.cxx:110:17
>  #32 in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at oox/source/core/filterbase.cxx:485:49
>  #33 in oox::ppt::PowerPointImport::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at oox/source/ppt/pptimport.cxx:215:24
>  #34 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2653:34
>  #35 in sd::DrawDocShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sd/source/ui/docshell/docshel4.cxx:457:39
>  #36 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:762:23
>  #37 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1981:36
>  #38 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:774:28
>  #39 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1181:37

after 3ad22de97d "SmartArt: Add posssibility to
edit (simple) text"

Change-Id: Ie6d2e8ec7fc8e07222cb85d50cf0d67df22d30ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195562
Tested-by: Armin Le Grand <Armin.Le.Grand@me.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-12 20:02:21 +01:00
Stephan Bergmann 230fc68daf Drop CustomTarge_desktop/soffice for non-MACOSX builds
...where it now always just copied a file from one place to another unchanged,
after 8595bdadb9 "remove JITC_PROCESSOR_TYPE
export for powerpc"

Change-Id: Ic078f3e29c7430f6553084c99685378ade023c38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195537
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-12 15:17:06 +01:00
Stephan Bergmann c6633d2dd3 loplugin:external
Change-Id: I02638ec326d99b77972b0665eead3a54eefe69fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-12 08:04:11 +01:00
Stephan Bergmann 9d158bf706 loplugin:casttovoid
Change-Id: Iebd463e83281f8aca119a87fe7cb30c3698935f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195443
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-12 08:03:53 +01:00
Stephan Bergmann a6325b777b Missing include
...for PATH_MAX, after 6112dac3ab "cool#13770 lok:
add a file save dialog callback"

Change-Id: I976c5ca00c441896042b3eb4565e386c717e4d4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195478
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-12 08:03:38 +01:00
Stephan Bergmann 9f84f4d4aa loplugin:simplifyconstruct
Change-Id: I976e5ccd954f1b25458c1e9eff0fd2b45e0fac57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195440
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-12 08:03:15 +01:00
Stephan Bergmann 3454432894 loplugin:externandnotdefined and loplugin:unreffun (--disable-gui)
Change-Id: Ie502257776f9482c24ba3e115e05110fc56d3ad4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195444
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-11 21:25:06 +01:00
Stephan Bergmann a5ea77b041 Avoid loplugin:stringviewparam
Change-Id: I36c7f954e7e63cf46b5cbcba16c99dadb3ca0c56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195441
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-11 21:24:34 +01:00
Stephan Bergmann 82413eb1f9 Improve PyUNO_cmp
...for cases where one operand is a PyUNO Adapter of the other (i.e., one
operand is a Python object that got passed out and back in again, and the other
operand is that same Python object).  This fixes the second "TODO" from
1e2e9a20a4 "More exhaustive testing of PyUNO type
mapping based on embindtest".

Change-Id: I0fc938db5c464ed56adee3b428537925fff0fc81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195392
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-11 21:24:20 +01:00
Stephan Bergmann 6b5d527c33 Reorder code blocks in doExecuteTest
...so that they match org.libreoffice.embindtest.XTest

Change-Id: I479af0607fc379be9b5f3ca477dd09bb943713b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195425
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-11 17:21:06 +01:00
Stephan Bergmann f53a339292 More exhaustive testing of PyUNO type mapping based on embindtest
...by implementing all the getSequence... variants that were left out of
3320b5fe2e "Add exhaustive testing of PyUNO type
mapping based on embindtest".

Change-Id: Ia0dde7362484f83923999db68d80f57c7baa914c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195426
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-11 16:24:41 +01:00
Stephan Bergmann 6057f92cb4 Only use uno.Any when Runtime::pyObject2Any would produce the wrong result
Change-Id: I339f2c80383e59505cb68e3712e39b25df2636e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195355
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-10 21:28:19 +01:00
Stephan Bergmann 7bdd020783 Fix any2PyObject mapping of UNO exceptions
That

>             // the exception base functions want to have an "args" tuple,
>             // which contains the message

code is there ever since e80bdbafeb "initial
checkin for the pyuno-0.9.2 release" for reasons that are not clear to me, but
at least in the "TODO" scenarios from 3320b5fe2e
"Add exhaustive testing of PyUNO type mapping based on embindtest" and
1e2e9a20a4 "More exhaustive testing of PyUNO type
mapping based on embindtest" (which are hereby fixed), that
PyObject_SetAttrString would cause a Python exception, cf.

> info:pyuno.runtime:1489432:1489432:pyuno/source/module/pyuno_runtime.cxx:533: setting exception args raised Python exception <class 'AttributeError'>: AttributeError('args')

so at least catch that.  (And maybe that code is obsolete anyway it would make
even more sense to drop it altogether.)

Change-Id: Ic651d106f34e0b316cba59ae66d2402b8f86b0f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195340
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-10 07:58:18 +01:00
Stephan Bergmann d89051d184 Don't use OUStringBuffer::apendAscii with UTF-8
(Stumbled over this when while preparing
1e2e9a20a4 "More exhaustive testing of PyUNO type
mapping based on embindtest" I accidentally forgot the

> from org.libreoffice.embindtest import Exception

in pyuno/qa/pytests/embindtest.py and thus PythonTest_pyuno_pytests_embindtest
would SIGABRT with

> sal/rtl/strtmpl.hxx:122: auto rtl::str::Copy(sal_Unicode *, const char *, sal_Int32)::(anonymous class)::operator()(char) const: Assertion `rtl::isAscii(static_cast<unsigned char>(c))' failed.

from pyuno::lcl_ExceptionMessage (with reprString being "('error', None,
-123456, 100.5, 'hä')") while trying to report

> uno.com.sun.star.uno.RuntimeException: Couldn't convert ('error', None, -123456, 100.5, 'hä') to a UNO type; caught exception: <class 'AttributeError'>: 'Exception' object has no attribute 'getTypes', traceback follows

.)

Change-Id: I4581061dbfa190266fef98dc670a058d6c98eaaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195304
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-09 23:56:38 +01:00
Stephan Bergmann 1e2e9a20a4 More exhaustive testing of PyUNO type mapping based on embindtest
...by implementing all the getAny... variants that were left out of
5f05929fd1498e418618d7570192877055de2c80 "Add exhaustive testing of PyUNO type
mapping based on embindtest".

Which revealed that the code in Adapter::invoke (in
pyuno/source/module/pyuno_adapter.cxx) was apparently broken, and would cause
the C++ call in doExecuteTest (in unotest/source/embindtest/embindtest.cxx) of
the Python

>     def getAnyByte(self):
>         return uno.Any('byte', -12)

(in pyuno/qa/pytests/embindtest.py) to fail with a nonsensical

> uno.com.sun.star.uno.RuntimeException: uno.Any instance not accepted during method call, use uno.invoke instead at pyuno/source/module/pyuno_runtime.cxx:785 at stoc/source/invocation_adapterfactory/iafactory.cxx:203

In addition, there's two new places marked with TODO comments:

For one, executing C++

>         bool const ok = test->isAnyException(val);

would cause an odd

> python.bin: Objects/typeobject.c:4745: PyObject *_PyType_Lookup(PyTypeObject *, PyObject *): Assertion `!PyErr_Occurred()' failed.

failure that needs further investigation.

And for another, executing Python

>         return value == self

would always return false.  It appears that PyUNO_cmp (in
pyuno/source/module/pyuno.cxx isn't yet prepared to be called with `that` being
a native Python UNO-implemenation object (`class Test(unohelper.Base, XTest)`)
instead of a proxy for a binary/C++ UNO object.

Change-Id: I0289e1f5ee6dab53b589af783c0c53302989394c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195287
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-09 14:00:54 +01:00
Stephan Bergmann 3320b5fe2e Add exhaustive testing of PyUNO type mapping based on embindtest
...in preparation for doing fixes for tdf#169229 "PyUNO: Hard to create null UNO
interface references, to use in a method invocation" etc.  (Basing it on
embindtest means it requires --enable-embindtest-uno, at least for now.)

Various places in pyuno/qa/pytests/embindtest.py are marked with TODO comments.
(Executing

>         v = test.getAnyException()

would cause an odd

> Fatal Python error: _Py_CheckFunctionResult: a function returned a result with an exception set

failure that needs further investigation.)

To not only test calls from PyUNO to binary (C++) UNO, but also from binary
(C++) UNO to PyUNO, add an executeTest method to the
org.libreoffice.embindtest.XTest interface.  For now, it only does those tests
that were already done by the org.libreoffice.embindtest.BridgeTest service
implementation, but the plan is to extend those (e.g., don't just only test
getAnyVoid, but all the getAny... variants).  And the corresponding Test class
implementation in pyuno/qa/pytests/embindtest.py for now only defines those
methods that are actually called, and will need to be extended as well.

Change-Id: I0dd66b9aed14cc7e679da78b86d0dc657625fe94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195238
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-08 21:28:43 +01:00
Stephan Bergmann fd00573b6c CLANG_16 is always true now
...after f0625d2291 "Update Clang baseline version
check"

Change-Id: I00c176fb044e425989fcabf7b3bdb2cf150a6fee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195206
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-08 10:40:54 +01:00
Stephan Bergmann 717ed1d0d4 Elide an obsolete Clang version check
...after version bump documented at 577aab3380
"README.md: don't be too exact with the compiler plugins Clang version"

Change-Id: If076181de79b3788d30c8f7b276c7919a5de80b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195208
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-08 07:36:26 +01:00
Stephan Bergmann 1ab2768960 Elide an obsolete Clang version check
...after f0625d2291 "Update Clang baseline version
check"

Change-Id: Iab8589cb3a38d81996f63c89910368a41d94a3ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195207
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-08 07:36:12 +01:00
Stephan Bergmann f0625d2291 Update Clang baseline version check
...after version bump documented at e8fd52037a
"Update README.md after Clang bump to 18"

Change-Id: If79439fb0f386f3d8f21a6cc6019ae1373e08245
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195197
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-07 21:35:00 +01:00
Stephan Bergmann 3289b1609e Adapt compilerplugins to Clang baseline bump
...as of e8fd52037a "Update README.md after Clang
bump to 18"

Change-Id: I2512205aa22ade1da17c414066a4f9e3d82bc99e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195099
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-07 16:46:58 +01:00
Stephan Bergmann fab0a9be45 Remove unused included
...that d1a2b80b9d "Bump compiler plugins Clang
baseline to 12.0.1" forgot

Change-Id: I87f2282ea076e66cb211b097dca4f0b86aecce68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195098
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-07 16:46:46 +01:00
Stephan Bergmann 73e279b28e loplugin:stringplusequal
Change-Id: Iee80a8d297843b9230b94cd41638784156451166
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194924
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-03 00:07:03 +01:00
Stephan Bergmann 1b7fc8a6e8 UBSan apparently needs SwXLineNumberingProperties RTTI now
...seeing CppunitTest_sw_writerfilter_misc failing with

> DynamicLibraryManagerException: "Failed to load dynamic library: /home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/LinkTarget/CppunitTest/libtest_sw_writerfilter_misc.so
/home/tdf/lode/jenkins/workspace/lo_ubsan/instdir/program/libsw_writerfilterlo.so: undefined symbol: _ZTI26SwXLineNumberingProperties"

(<https://ci.libreoffice.org/job/lo_ubsan/3736/>)

Change-Id: Iab88c2172dd3aabf80bc7e826576e16620ac2fb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194928
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-02 22:54:41 +01:00
Stephan Bergmann 9461a6a1cd UBSan apparently needs SwXFrames and SwXTextSections RTTI now
...seeing CppunitTest_sw_uiwriter8 failing with

> warn:sal.osl:2288248:2288248:sal/osl/unx/module.cxx:103: dlopen(/home/sberg/lo/core/instdir/program/libsw_writerfilterlo.so, 257): /home/sberg/lo/core/instdir/program/libsw_writerfilterlo.so: undefined symbol: _ZTI9SwXFrames

and

> warn:sal.osl:2291977:2291977:sal/osl/unx/module.cxx:103: dlopen(/home/sberg/lo/core/instdir/program/libswuilo.so, 257): /home/sberg/lo/core/instdir/program/libswuilo.so: undefined symbol: _ZTI15SwXTextSections

Change-Id: Iffd0b1b40f3b8196b8912e1c6157bb7194f58dc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194892
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-01 17:56:17 +01:00
Stephan Bergmann 1fc95f3bfa !HAVE_FEATURE_SCRIPTING apparently needs SbiRuntime::isVBAEnabled now
...after 76aafa18b7 "tdf#162711 - VBASupport
requires banker’s rounding for integer conversions", as linking started to fail
with

> wasm-ld: error: /home/sberg/lo-wasm-upstream/core/instdir/program/libsblo.a(sbxint.o): undefined symbol: SbiRuntime::isVBAEnabled()

Change-Id: I579f300390eabfefd5f02c277771d5f8c937105c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194734
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-28 00:12:07 +01:00
Stephan Bergmann 04311ac7bf Fix race between MissingPluginInstallerThread launch() and join()
CppunitTest_slideshow_engine occasionally failed at least on
<https://ci.libreoffice.org/job/gerrit_linux_gcc_release/>, with a
MissingPluginInstallerThread still executing during exit.  What happened was
that the join() in MissingPluginInstaller::detach was executed before the
launch() in the MissingPluginInstaller launchUi link was called.  So that call
to join() did nothing (cf. the documentation of osl_joinWithThread in
include/osl/thread.h: "Returns immediately if Thread is NULL.") and then the
call to create() started executing the thread during exit.

Change-Id: I5141eba64e6631cbf41026af4bbee4fc0a285a4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194686
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Code-Style: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-27 13:57:07 +01:00
Stephan Bergmann 62c9a233da Even more CppunitTests need the ASan hack now
...from e854abe076 "Avoid external processes
picking up instdir/program/libnspr4.so"

Change-Id: Ice98a5ba06a4a6251fe68aee3c24ed9451eb8edd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194544
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Code-Style: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-26 13:51:24 +01:00
Stephan Bergmann f38f481301 Host only solenv/flatpak-external-tarballs.json.in here
...and include the external-tarballs.json resulting from

> make -s cmd cmd='${SRCDIR}/solenv/bin/generate-flatpak-manifest.sh' > external-tarballs.json

in the org.libreoffice.LibreOffice.json that will then only be hosted at
<https://github.com/flathub/org.libreoffice.LibreOffice> (to avoid needless
duplication)

Change-Id: I35c2f7b4613457126202f82f7b63ae4c34f8b1b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194525
Code-Style: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-25 19:44:23 +01:00
Stephan Bergmann 6d12a896d6 Clean the artifacts that rust_uno/CustomTarget_* put in $(SRCDIR)
This is a temporary measure.  The right fix will be to not have those
CustomTargets put anything into $(SRCDIR) in the first place.

Change-Id: Ib211b5bc5e0059c8c8206c044e28443265d69353
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194517
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Code-Style: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-25 14:59:18 +01:00
Stephan Bergmann 49ef699834 Adapt to fix of C++ LWG 172
...<https://cplusplus.github.io/LWG/issue172> "Inconsistent types for
basic_istream::ignore()"

Change-Id: I3a19b0528cd5c532501a09e4df706e50d9411d5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194423
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-11-24 12:50:17 +01:00
Stephan Bergmann 6f2c4eeb60 Even more CppunitTests need the ASan hack now
...from e854abe076 "Avoid external processes
picking up instdir/program/libnspr4.so"

Change-Id: I2d9a73050433f5f52061aeadd1a3f8a24b88d826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194346
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-11-22 16:11:45 +01:00
Stephan Bergmann 77ed394924 Bump the Emscripten build to emsdk 4.0.10
...as building against emsdk 3.1.46 now started to fail with

> /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_wasm/svx/source/svdraw/svdmrkv.cxx:1231:78: error: no member named 'view' in 'std::stringstream'
>  1231 |                 handleArrayStr = OString::Concat(", \"handles\":") + aStream.view();
>       |                                                                      ~~~~~~~ ^
> /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_wasm/svx/source/svdraw/svdmrkv.cxx:1236:86: error: no member named 'view' in 'std::stringstream'
>  1236 |                     handleArrayStr += OString::Concat(", \"GluePoints\":") + aStream.view();
>       |                                                                              ~~~~~~~ ^

(<https://ci.libreoffice.org//job/lo_daily_tb_linux_wasm/1251/>) after
47da2ff20e "Avoid some std::string creation".

So just bump to the most recent emsdk version that works out of the box.
Anything newer than emsdk 4.0.10 (like the current emsdk 4.0.20) would currently
fail for us with the issue described at
<https://gerrit.libreoffice.org/c/core/+/188465> "Emscripten: Adapt to internal
emscripten/val.h change in Emscripten 4.0.11", though, so stick with emsdk
4.0.10 for now.

Change-Id: I540569e43454c222424895b1e552b8b07d1d5066
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194331
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-22 11:11:21 +01:00
Stephan Bergmann 2a62fe6a6b Drop unnecessary casts
...that should arguably have been dropped latest when
86313f0533 "loplugin:stringadd in sc" changed this
from using OUStringBuffer::append to OUString::number

Change-Id: I5d6a76e4b7a83e3f998bb2295b1399f62447a70f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194209
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-19 19:07:21 +01:00
Stephan Bergmann 76d85a1364 Parametrize assemble-flatpak over the flatpak ID
(solenv/bin/assemble-flatpak-desktop.sh in one place uses that parameterized
value in a sed s command replacement text, which could potentially cause syntax
errors.  But since flatpak IDs shall be formed from a restricted alphabet, that
should not cause problems in practice.  Similarly, various places across the
solenv/bin/assemble-flatpak*.sh scripts use that perameterized value in forming
pathnames, and assume that it does not contain any slahses.)

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192883
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
(cherry picked from commit 15007243c11363c636d74c240946237da5a866b8)
Conflicts:
	solenv/bin/assemble-flatpak-appdata.sh
	solenv/bin/assemble-flatpak-desktop.sh
	solenv/bin/assemble-flatpak.sh
	solenv/flatpak-manifest.in

Change-Id: I5b4c031acf19b04ac8b501d9d8557924747fb38b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194174
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-19 08:18:22 +01:00
Stephan Bergmann 1a52b9141e Missing include
Change-Id: I0c9b387dc946e8eee8bb800184d95b138d897f32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194157
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-11-18 15:51:23 +01:00
Stephan Bergmann c089e38b88 Adpat flatpak to recent external additions
Change-Id: I1ce749b532da597b2af24277c4a01aee23f26c7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194159
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-18 15:36:11 +01:00
Stephan Bergmann 4407876d92 Revert part of "register caches with ImplSVData"...
...and of "use a different memory allocation strategy for caches"

This reverts the sw/source/core/ole/ndole.cxx part of commit
3fc2216aa394222e7f3f4f0f4f78c5f198c694f5 and of commit
b8935ee3b43e515b4a2810bb51a8bf17b90b7446 for now, as it causes

> ==489880==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c4dc7e22210 at pc 0x7b6d336739b2 bp 0x7ffc09ed2d50 sp 0x7ffc09ed2d48
> READ of size 8 at 0x7c4dc7e22210 thread T0 (kitbroker_003)
>  #0 in __gnu_cxx::__normal_iterator<SwOLEObj* const*, std::__cxx1998::vector<SwOLEObj*, std::pmr::polymorphic_allocator<SwOLEObj*>>>::__normal_iterator(SwOLEObj* const* const&) at /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/stl_iterator.h:1059:20
>  #1 in std::__cxx1998::vector<SwOLEObj*, std::pmr::polymorphic_allocator<SwOLEObj*>>::begin() const at /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/stl_vector.h:1009:16
>  #2 in std::__cxx1998::vector<SwOLEObj*, std::pmr::polymorphic_allocator<SwOLEObj*>>::empty() const at /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/stl_vector.h:1224:16
>  #3 in (anonymous namespace)::SwOLELRUCache::dropCaches() at core/sw/source/core/ole/ndole.cxx:98:29
>  #4 in ImplSVData::dropCaches() at core/vcl/source/app/svdata.cxx:455:43
>  #5 in vcl::lok::trimMemory(int) at core/vcl/source/app/svapp.cxx:1800:18
>  #6 in lo_trimMemory(_LibreOfficeKit*, int) at core/desktop/source/lib/init.cxx:3403:5
>  #7 in Document::trimAfterInactivity() at online/kit/Kit.cpp:1122:17
>  #8 in KitSocketPoll::kitPoll(int) at online/kit/Kit.cpp:3045:20
>  #9 in SvpSalInstance::ImplYield(bool, bool) at core/vcl/headless/svpinst.cxx:463:31
>  #10 in SvpSalInstance::DoYield(bool, bool) at core/vcl/headless/svpinst.cxx:504:21
>  #11 in ImplYield(bool, bool) at core/vcl/source/app/svapp.cxx:389:48
>  #12 in Application::Yield() at core/vcl/source/app/svapp.cxx:492:5
>  #13 in Application::Execute() at core/vcl/source/app/svapp.cxx:364:13
>  #14 in desktop::Desktop::Main() at core/desktop/source/app/app.cxx:1680:13
>  #15 in ImplSVMain() at core/vcl/source/app/svmain.cxx:228:35
>  #16 in SVMain() at core/vcl/source/app/svmain.cxx:246:12
>  #17 in soffice_main at core/desktop/source/app/sofficemain.cxx:121:12
>  #18 in lo_runLoop(_LibreOfficeKit*, int (*)(void*, int), void (*)(void*), void*) at core/desktop/source/lib/init.cxx:7849:9
>  #19 in lokit_main(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool, bool, bool, bool, bool, unsigned long) at online/kit/Kit.cpp:3928:16
>  #20 in createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)::$_0::operator()() const at online/kit/ForKit.cpp:553:13
>  #21 in void std::__invoke_impl<void, createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)::$_0&>(std::__invoke_other, createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)::$_0&) at /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/invoke.h:63:14
>  #22 in std::enable_if<is_invocable_r_v<void, createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)::$_0&>, void>::type std::__invoke_r<void, createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)::$_0&>(createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)::$_0&) at /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/invoke.h:113:2
>  #23 in std::_Function_handler<void (), createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)::$_0>::_M_invoke(std::_Any_data const&) at /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/std_function.h:292:9
>  #24 in std::function<void ()>::operator()() const at /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/std_function.h:593:9
>  #25 in forkKit(std::function<void ()> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::function<void (int)> const&) at online/kit/ForKit.cpp:496:9
>  #26 in createLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool) at online/kit/ForKit.cpp:573:20
>  #27 in forkLibreOfficeKit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) at online/kit/ForKit.cpp:698:39
>  #28 in forkit_main(int, char**) at online/kit/ForKit.cpp:1100:17
>  #29 in __libc_start_call_main at <null>

Change-Id: I8fdc88ca965e27c16b92df1c05e95eca23ab57b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190379
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit c72ceaebcfde7497db97eb105144bce6685e83f8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193982
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-11-14 08:07:24 +01:00
Stephan Bergmann a799a6b395 Emscripten: Avoid -Werror,-Wswitch
Change-Id: Iba6fa6bc31cf3b6147d8c8908044c6ac273de5cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193943
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-11-13 23:39:22 +01:00
Stephan Bergmann 8854a990f2 configmgr/winreg: Mention the HKEY in SAL_INFOs
Change-Id: Ib284a7124547dc2e13e2fe3d2262ea79bab957b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193966
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-13 23:38:52 +01:00
Stephan Bergmann 6647890535 Emscripten: Missing include
...after fd2e467ba3 "tdf#146619 Run IWYU in fw
decl mode on include/[a-c]*"

Change-Id: I73003f176f13cff87dca28d0feb77986448dd6ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193942
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-13 13:06:18 +01:00
Stephan Bergmann 5429ad357b Fix loplugin warnings in --enable-rust-uno code
...an assortment of loplugin:staticmethods, loplugin:stringadd, and
loplugin:stringviewparam

Change-Id: Iaa62c0162014a31de7d1f910199f241747f2feea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193167
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-29 22:37:20 +01:00
Stephan Bergmann 4f99a53b66 Avoid -Werror=maybe-uninitialized
...as seen at least with --disable-optimized against recent GCC 16 trunk,

> In file included from workdir/UnoApiHeadersTarget/udkapi/comprehensive/com/sun/star/lang/XTypeProvider.hpp:11,
>                  from include/cppuhelper/implbase.hxx:28,
>                  from cppuhelper/source/component_context.cxx:30:
> include/com/sun/star/uno/Sequence.hxx: In constructor ‘com::sun::star::uno::Sequence< <template-parameter-1-1> >::Sequence(sal_Int32) [with E = rtl::OUString]’:
> include/com/sun/star/uno/Sequence.hxx:97:55: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>    97 |     const Type & rType = ::cppu::getTypeFavourUnsigned( this );
>       |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
> include/com/sun/star/uno/Sequence.hxx:326:1: note: by argument 1 of type ‘const com::sun::star::uno::Sequence<rtl::OUString>*’ to ‘const com::sun::star::uno::Type& cppu::getTypeFavourUnsigned(const com::sun::star::uno::Sequence<T>*) [with T = rtl::OUString]’ declared here
>   326 | getTypeFavourUnsigned(
>       | ^~~~~~~~~~~~~~~~~~~~~
> include/com/sun/star/uno/Sequence.hxx: In constructor ‘com::sun::star::uno::Sequence< <template-parameter-1-1> >::Sequence() [with E = com::sun::star::uno::Any]’:
> include/com/sun/star/uno/Sequence.hxx:60:55: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>    60 |     const Type & rType = ::cppu::getTypeFavourUnsigned( this );
>       |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
> include/com/sun/star/uno/Sequence.hxx:326:1: note: by argument 1 of type ‘const com::sun::star::uno::Sequence<com::sun::star::uno::Any>*’ to ‘const com::sun::star::uno::Type& cppu::getTypeFavourUnsigned(const com::sun::star::uno::Sequence<T>*) [with T = com::sun::star::uno::Any]’ declared here
>   326 | getTypeFavourUnsigned(
>       | ^~~~~~~~~~~~~~~~~~~~~
> include/com/sun/star/uno/Sequence.hxx: In constructor ‘com::sun::star::uno::Sequence< <template-parameter-1-1> >::Sequence() [with E = signed char]’:
> include/com/sun/star/uno/Sequence.hxx:60:55: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>    60 |     const Type & rType = ::cppu::getTypeFavourUnsigned( this );
>       |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
> include/com/sun/star/uno/Sequence.hxx:326:1: note: by argument 1 of type ‘const com::sun::star::uno::Sequence<signed char>*’ to ‘const com::sun::star::uno::Type& cppu::getTypeFavourUnsigned(const com::sun::star::uno::Sequence<T>*) [with T = signed char]’ declared here
>   326 | getTypeFavourUnsigned(
>       | ^~~~~~~~~~~~~~~~~~~~~

Change-Id: I700c8a9f2116ff9f017d50b161794bfe06e74e1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193057
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-29 07:57:43 +01:00
Stephan Bergmann d1d7660f39 Copy from rSource, not from *this
...which had been the case ever since 3a08fe4de3
"INTEGRATION: CWS notes2 (1.1.2); FILE ADDED", but caused

> filter/source/msfilter/msdffimp.cxx: In constructor ‘SvxMSDffManager::SvxMSDffManager(SvStream&, rtl::OUString)’:
> filter/source/msfilter/msdffimp.cxx:5810:24: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>  5810 |      mbSkipImages(false)
>       |                        ^
> filter/source/msfilter/msdffimp.cxx:239:1: note: by argument 2 of type ‘const SvxMSDffManager&’ to ‘DffPropertyReader::DffPropertyReader(const SvxMSDffManager&)’ declared here
>   239 | DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan )
>       | ^~~~~~~~~~~~~~~~~
> filter/source/msfilter/msdffimp.cxx: In constructor ‘SvxMSDffManager::SvxMSDffManager(SvStream&, rtl::OUString, sal_uInt32, SvStream*, SdrModel*, tools::Long, Color, SvStream*, bool)’:
> filter/source/msfilter/msdffimp.cxx:5769:31: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>  5769 |      mbSkipImages (bSkipImages)
>       |                               ^
> filter/source/msfilter/msdffimp.cxx:239:1: note: by argument 2 of type ‘const SvxMSDffManager&’ to ‘DffPropertyReader::DffPropertyReader(const SvxMSDffManager&)’ declared here
>   239 | DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan )
>       | ^~~~~~~~~~~~~~~~~

at least with --disable-optimized against recent GCC 16 trunk

Change-Id: Ie908dba33d426f72f7819b3db0651a60cb3004c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193060
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-28 10:13:08 +01:00
Stephan Bergmann c0370b81ee Copy from rSource, not from *this
...which had been the case ever since 5d431414af
"CWS-TOOLING: integrate CWS impressnotes01", but caused

> svx/source/annotation/TextAPI.cxx:187:32: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>   187 |     , mpHolder(rSource.mpHolder) // shallow copy; uses internal refcounting
>       |                                ^
> In file included from include/editeng/unotext.hxx:55,
>                  from include/svx/annotation/TextAPI.hxx:22,
>                  from svx/source/annotation/TextAPI.cxx:24:
> include/editeng/unoedsrc.hxx:59:5: note: by argument 2 of type ‘const SvxEditSource&’ to ‘constexpr SvxEditSource::SvxEditSource(const SvxEditSource&)’ declared here
>    59 |     SvxEditSource(SvxEditSource const &) = default;
>       |     ^~~~~~~~~~~~~

at least with --disable-optimized against recent GCC 16 trunk

Change-Id: I2815df15042444aa2826f25262253cb78ec0da68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193059
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-28 07:53:15 +01:00
Stephan Bergmann b792c42325 Silence -Werror=maybe-uninitialized
...as seen at least with --disable-optimized against recent GCC 16 trunk,

> filter/source/msfilter/msdffimp.cxx:5810:24: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>  5810 |      mbSkipImages(false)
>       |                        ^
> filter/source/msfilter/msdffimp.cxx:239:1: note: by argument 2 of type ‘const SvxMSDffManager&’ to ‘DffPropertyReader::DffPropertyReader(const SvxMSDffManager&)’ declared here
>   239 | DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan )
>       | ^~~~~~~~~~~~~~~~~
> filter/source/msfilter/msdffimp.cxx: In constructor ‘SvxMSDffManager::SvxMSDffManager(SvStream&, rtl::OUString, sal_uInt32, SvStream*, SdrModel*, tools::Long, Color, SvStream*, bool)’:
> filter/source/msfilter/msdffimp.cxx:5769:31: error: ‘<unknown>’ may be used uninitialized [-Werror=maybe-uninitialized]
>  5769 |      mbSkipImages (bSkipImages)
>       |                               ^
> filter/source/msfilter/msdffimp.cxx:239:1: note: by argument 2 of type ‘const SvxMSDffManager&’ to ‘DffPropertyReader::DffPropertyReader(const SvxMSDffManager&)’ declared here
>   239 | DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan )
>       | ^~~~~~~~~~~~~~~~~

Change-Id: Ib1cb233e0208c8316db399c369a4879bca5b31eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193058
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-28 07:53:01 +01:00
Stephan Bergmann ad6e817e38 Fix presumed | vs. & typos
...introduced in 25e08e4ea0 "Resolves: tdf#164920
add scrollbar width to desired size if enabled" and causing

> svx/source/tbxctrls/linectrl.cxx:435:15: error: bitwise or with non-zero value always evaluates to true [-Werror,-Wtautological-bitwise-compare]
>   435 |     if (nBits | WB_VSCROLL)
>       |         ~~~~~~^~~~~~~~~~~~
> svx/source/tbxctrls/linectrl.cxx:576:15: error: bitwise or with non-zero value always evaluates to true [-Werror,-Wtautological-bitwise-compare]
>   576 |     if (nBits | WB_VSCROLL)
>       |         ~~~~~~^~~~~~~~~~~~

Change-Id: I6f77cd30f3b98abb15afb665b336fba13d46ee01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192963
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-25 08:35:40 +02:00
Stephan Bergmann 3a01a57eea Fix assemble-flatpak.sh for builds w/o --with-lang=...
...where there is no /app/libreoffice/share/registry/res/registry_*.xcd, which
would have caused

> mv: cannot stat '/app/libreoffice/share/registry/res/registry_*.xcd': No such file or directory

to fail.  (The corresponding gid_File_Registry_Lang in
scp2/source/ooo/file_ooo.scp is EXTRA_ALL_LANG_BUT_EN_US, while the
scp2/source/ooo/file_ooo.scp entries corresponding to the other two globs are
EXTRA_ALL_LANG (gid_File_Registry_Filter_Zip) and FILE_ALL_LANG_LETTER
(gid_File_Registry_Spool_Langpack_Lang), respectively; that's why only the
registry_*.xcd glob could ever fail to match anything.)

Change-Id: Ifc947b35ec9927306e02ec76aa1aac531bdb89b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192871
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-22 20:46:42 +02:00
Stephan Bergmann fc7232b50d external/afdko: Address lots of UBSan findings
...in CppunitTest_sd_pdf_import_test and CppunitTest_sd_export_tests,

> workdir/UnpackedTarball/afdko/c/shared/source/t1write/t1write.c:379:21: runtime error: signed integer overflow: 47774 * 52845 cannot be represented in type 'int'
>  #0 in saveCstr at workdir/UnpackedTarball/afdko/c/shared/source/t1write/t1write.c:379:21
>  #1 in saveSubr at workdir/UnpackedTarball/afdko/c/shared/source/t1write/t1write.c:572:9
>  #2 in saveStdSubr at workdir/UnpackedTarball/afdko/c/shared/source/t1write/t1write.c:587:11
>  #3 in saveStdSubrs at workdir/UnpackedTarball/afdko/c/shared/source/t1write/t1write.c:611:5
>  #4 in t1wBegFont at workdir/UnpackedTarball/afdko/c/shared/source/t1write/t1write.c:2103:5
>  #5 in t1_BegFont at workdir/UnpackedTarball/afdko/c/shared/source/tx_shared/tx_shared.c:2230:13
>  #6 in ttrReadFont at workdir/UnpackedTarball/afdko/c/shared/source/tx_shared/tx_shared.c:4956:5
>  #7 in convertTx(txCtx_*) at vcl/source/gdi/embeddedfontsafdko.cxx:55:17
>  #8 in EmbeddedFontsManager::tx_t1(rtl::OUString const&, rtl::OUString const&) at vcl/source/gdi/embeddedfontsafdko.cxx:116:19
>  #9 in toPfaCID(SubSetInfo&, rtl::OUString const&, rtl::OUString const&, bool&, std::__debug::map<int, int, std::less<int>, std::allocator<std::pair<int const, int>>>&, rtl::OString&, rtl::OString&, rtl::OString&) at svx/source/svdraw/svdpdf.cxx:1189:14
>  #10 in ImpSdrPdfImport::convertToOTF(long, SubSetInfo&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t>>, std::__debug::vector<unsigned char, std::allocator<unsigned char>> const&) at svx/source/svdraw/svdpdf.cxx:1674:10
>  #11 in ImpSdrPdfImport::CollectFonts() at svx/source/svdraw/svdpdf.cxx:328:27
>  #12 in ImpSdrPdfImport::ImpSdrPdfImport(SdrModel&, o3tl::strong_int<short, SdrLayerIDTag>, tools::Rectangle const&, Graphic const&) at svx/source/svdraw/svdpdf.cxx:122:5
>  #13 in SdrEditView::DoImportMarkedMtf(SvdProgressInfo*) at svx/source/svdraw/svdedtv2.cxx:2168:37
>  #14 in testImportSimpleText::TestBody() at sd/qa/unit/SdrPdfImportTest.cxx:122:32

etc. and

> workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/recode.c:1744:17: runtime error: left shift of negative value -51
>  #0 in t1parse at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/recode.c:1744:17
>  #1 in cstrRecode at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/recode.c:3279:11
>  #2 in recodeAddChar at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/recode.c:3383:5
>  #3 in csAddChar at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/cs.c:152:5
>  #4 in cidAddChars at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/parse.c:3001:13
>  #5 in parseFont at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/parse.c:1507:9
>  #6 in tcAddFont at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/tc.c:1006:5
>  #7 in tcCompactFont at workdir/UnpackedTarball/afdko/c/makeotf/lib/typecomp/tc.c:1054:5
>  #8 in hotReadFont at workdir/UnpackedTarball/afdko/c/makeotf/lib/hotconv/hot.c:369:5
>  #9 in psConvFont at workdir/UnpackedTarball/afdko/c/makeotf/source/cb.c:329:16
>  #10 in cbConvert at workdir/UnpackedTarball/afdko/c/makeotf/source/cb.c:1622:20
>  #11 in EmbeddedFontsManager::makeotf(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&) at vcl/source/gdi/embeddedfontsafdko.cxx:263:5
>  #12 in ImpSdrPdfImport::convertToOTF(long, SubSetInfo&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t>>, std::__debug::vector<unsigned char, std::allocator<unsigned char>> const&) at svx/source/svdraw/svdpdf.cxx:1721:9
>  #13 in ImpSdrPdfImport::CollectFonts() at svx/source/svdraw/svdpdf.cxx:328:27
>  #14 in ImpSdrPdfImport::ImpSdrPdfImport(SdrModel&, o3tl::strong_int<short, SdrLayerIDTag>, tools::Rectangle const&, Graphic const&) at svx/source/svdraw/svdpdf.cxx:122:5
>  #15 in SdrEditView::DoImportMarkedMtf(SvdProgressInfo*) at svx/source/svdraw/svdedtv2.cxx:2168:37
>  #16 in testImportSimpleText::TestBody() at sd/qa/unit/SdrPdfImportTest.cxx:122:32

etc. and

> workdir/UnpackedTarball/afdko/c/mergefonts/source/mergeFonts.c:300:5: runtime error: call to function cfwMergeFDArray through pointer to incorrect function type 'long (*)(void *, abfTopDict *, int *)'
> workdir/UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite.c:491: note: cfwMergeFDArray defined here
>  #0 in mergeFDArray at workdir/UnpackedTarball/afdko/c/mergefonts/source/mergeFonts.c:300:5
>  #1 in t1rMergeFont at workdir/UnpackedTarball/afdko/c/mergefonts/source/mergeFonts.c:390:13
>  #2 in mergeFile at workdir/UnpackedTarball/afdko/c/mergefonts/source/mergeFonts.c:1521:17
>  #3 in doMergeFileSet at workdir/UnpackedTarball/afdko/c/mergefonts/source/mergeFonts.c:1726:9
>  #4 in EmbeddedFontsManager::mergefonts(rtl::OUString const&, rtl::OUString const&, std::__debug::vector<std::pair<rtl::OUString, rtl::OUString>, std::allocator<std::pair<rtl::OUString, rtl::OUString>>> const&) at vcl/source/gdi/embeddedfontsafdko.cxx:179:24
>  #5 in toPfaCID(SubSetInfo&, rtl::OUString const&, rtl::OUString const&, bool&, std::__debug::map<int, int, std::less<int>, std::allocator<std::pair<int const, int>>>&, rtl::OString&, rtl::OString&, rtl::OString&) at svx/source/svdraw/svdpdf.cxx:1197:14
>  #6 in ImpSdrPdfImport::convertToOTF(long, SubSetInfo&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t>>, std::__debug::vector<unsigned char, std::allocator<unsigned char>> const&) at svx/source/svdraw/svdpdf.cxx:1674:10
>  #7 in ImpSdrPdfImport::CollectFonts() at svx/source/svdraw/svdpdf.cxx:328:27
>  #8 in ImpSdrPdfImport::ImpSdrPdfImport(SdrModel&, o3tl::strong_int<short, SdrLayerIDTag>, tools::Rectangle const&, Graphic const&) at svx/source/svdraw/svdpdf.cxx:122:5
>  #9 in SdrEditView::DoImportMarkedMtf(SvdProgressInfo*) at svx/source/svdraw/svdedtv2.cxx:2168:37
>  #10 in testImportSimpleText::TestBody() at sd/qa/unit/SdrPdfImportTest.cxx:122:32

and

> workdir/UnpackedTarball/afdko/c/shared/source/dynarr/dynarr.c:111:9: runtime error: call to function initCharset through pointer to incorrect function type 'void (*)(void *, long, void *)'
> workdir/UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_charset.c:76: note: initCharset defined here
>  #0 in dnaGrow at workdir/UnpackedTarball/afdko/c/shared/source/dynarr/dynarr.c:111:9
>  #1 in dnaNext at workdir/UnpackedTarball/afdko/c/shared/source/dynarr/dynarr.c:162:13
>  #2 in cfwCharsetNew at workdir/UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite_charset.c:98:28
>  #3 in cfwNew at workdir/UnpackedTarball/afdko/c/shared/source/cffwrite/cffwrite.c:2236:5
>  #4 in cff_SetMode at workdir/UnpackedTarball/afdko/c/shared/source/tx_shared/tx_shared.c:1129:22
>  #5 in setMode at workdir/UnpackedTarball/afdko/c/shared/source/tx_shared/tx_shared.c:5585:13
>  #6 in EmbeddedFontsManager::mergefonts(rtl::OUString const&, rtl::OUString const&, std::__debug::vector<std::pair<rtl::OUString, rtl::OUString>, std::allocator<std::pair<rtl::OUString, rtl::OUString>>> const&) at vcl/source/gdi/embeddedfontsafdko.cxx:167:5
>  #7 in toPfaCID(SubSetInfo&, rtl::OUString const&, rtl::OUString const&, bool&, std::__debug::map<int, int, std::less<int>, std::allocator<std::pair<int const, int>>>&, rtl::OString&, rtl::OString&, rtl::OString&) at svx/source/svdraw/svdpdf.cxx:1197:14
>  #8 in ImpSdrPdfImport::convertToOTF(long, SubSetInfo&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t>>, std::__debug::vector<unsigned char, std::allocator<unsigned char>> const&) at svx/source/svdraw/svdpdf.cxx:1674:10
>  #9 in ImpSdrPdfImport::CollectFonts() at svx/source/svdraw/svdpdf.cxx:328:27
>  #10 in ImpSdrPdfImport::ImpSdrPdfImport(SdrModel&, o3tl::strong_int<short, SdrLayerIDTag>, tools::Rectangle const&, Graphic const&) at svx/source/svdraw/svdpdf.cxx:122:5
>  #11 in SdrEditView::DoImportMarkedMtf(SvdProgressInfo*) at svx/source/svdraw/svdedtv2.cxx:2168:37
>  #12 in testImportSimpleText::TestBody() at sd/qa/unit/SdrPdfImportTest.cxx:122:32

but which has been suppressed at least for now with an

> __attribute__((no_sanitize("function")))

as that appears to be a pervasive issue with the dnaDCL macro defined in
workdir/UnpackedTarball/afdko/c/shared/include/dynarr.h

Change-Id: Ib259a660713fa87f45020fefa841483cf810fc45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192733
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-20 23:31:46 +02:00
Stephan Bergmann 4c58d82180 Enable compilerplugins/clang/test/constparams again
...after e07a0568b0 "move loplugin:constparams out
of store again"

Change-Id: Ib51601cc494a51a5abe497ed4989af04229c89f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192555
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-17 08:01:42 +02:00
Stephan Bergmann 72108d7860 Adapt check-elf-dynamic-objects for --enable-kf6
...where it failed with

> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libKF6CoreAddons.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libKF6I18n.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libKF6ConfigCore.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libKF6WindowSystem.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libKF6KIOCore.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libKF6KIOWidgets.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libKF6KIOFileWidgets.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libQt6Core.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libQt6Gui.so.6
> instdir/program/libvclplug_kf6lo.so has suspicious NEEDED: libQt6Widgets.so.6

at least in my build on Fedora 43

Change-Id: I03221271af850e4fc5132fde2062988d6d144e76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192556
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-17 08:01:20 +02:00
Stephan Bergmann 390f378723 Remove atticized compilerplugins and their accompanying tests
(see the discussion starting in the comments at
<https://gerrit.libreoffice.org/c/core/+/136841/3#message-2d2ff562ccd80cf776f0b2068f028dd22a40e4e9>
"move old/unused plugins to store")

Change-Id: I9582e934c3224dd0a4c25d0574b47f9ee49ed611
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192554
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-17 08:00:14 +02:00
Stephan Bergmann c1ab75b146 compilerplugins: Rename getOriginalDecl back to getDecl
...to match
<https://github.com/llvm/llvm-project/commit/b516dcc998d06c97d874af543489887f7e5a680c>
"[clang] NFC: rename TagType::getOriginalDecl back to getDecl (#163271)"

Change-Id: I11a6a261660cd3786dbb03acdf5e610e165a880e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192553
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-17 07:58:58 +02:00
Stephan Bergmann 309d9488f1 Fix --disable-pdfimport builds
...like the Emscripten one, which started to fail with

> In file included from vcl/source/gdi/embeddedfontsafdko.cxx:18:
> vcl/source/gdi/afdko.hxx:18:10: fatal error: 'tx_shared.h' file not found
>    18 | #include <tx_shared.h>
>       |          ^~~~~~~~~~~~~

after fe9e639b38e6b6a07e0a37e215d1fc75e62e537b "add apis for font format
conversion and merging"

Change-Id: Ida6d97dbb1ab5ddc204e0421736d9ecf06c98a2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191669
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 71ba3817eb8cf2ac55b5c726b1c14e6e7cd597f1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192337
Tested-by: Jenkins
2025-10-14 17:14:51 +02:00
Stephan Bergmann ebca26e903 Explain the seemingly unused LokHookPreInit2 typedef
...which had apparently always been unused since it got introduced in
5de22d1e55 "Handle 'addfont' from Collabora
Online", but is used by e.g.
<https://github.com/CollaboraOnline/online/commit/f98900c73c357af4588dfe95c191b4bf2020ea1e>
"Add a remote font download feature"

Change-Id: I292672d140356e8a0562d383452536924dd3b17b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192090
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Jenkins
2025-10-10 15:33:02 +02:00
Stephan Bergmann 2f4f578bbf Failure to getBasicLibraries() is normal in --disable-scripting builds
...(like the Emscripten build), see the HAVE_FEATURE_SCRIPTING conditions in
SfxObjectShell::GetBasicContainer (sfx2/source/doc/objxtor.cxx) and
SfxApplication::GetBasicContainer (sfx2/source/appl/appbas.cxx), so in such
builds loading e.g. xmloff/qa/unit/data/MCGR_threeStops.fodt containing

>  <office:scripts>
>   <office:script script:language="ooo:Basic">
>    <ooo:libraries xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink">
>     <ooo:library-embedded ooo:name="Standard"/>
>    </ooo:libraries>
>   </office:script>
>  </office:scripts>

would fail with

> warn:sax:392777:392777:sax/source/fastparser/fastparser.cxx:645: Unexpected exception from XML parser com.sun.star.xml.sax.SAXException message: "nowhere to import to at xmloff/source/script/xmlbasicscript.cxx:96"
>     wrapped:

and a

> General Error.
> General input/output error.

error box.  But all the code paths using m_xLibContainer appear to first check
it to be non-null, so it seems rather harmless to make a null m_xLibContainer
non-fatal here for such builds at least.

Change-Id: I6f20b15cb4032fc6293aaae6551095125360171e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192076
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-09 07:58:55 +02:00
Stephan Bergmann 87974ca984 external/clucene: Avoid ASan wcsncpy-param-overlap
...as seen after
<https://github.com/llvm/llvm-project/commit/6ca835b7f4349ad55c8e8afdf0669927b6b284b4>
"[compiler-rt][asan] Add wcscpy/wcsncpy; enable wcscat/wcsncat on Windows
(#160493)" when building Extension_nlpsolver,

> ==1084736==ERROR: AddressSanitizer: wcsncpy-param-overlap: memory ranges [0x7cacc15e1480,0x7cacc15e1498) and [0x7cacc15e1480, 0x7cacc15e1498) overlap
>  #0 in wcsncpy at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:664:5
>  #1 in lucene::util::StringBuffer::prepend(wchar_t const*, unsigned long) at workdir/UnpackedTarball/clucene/src/shared/CLucene/util/StringBuffer.cpp:233:7
>  #2 in lucene::util::StringBuffer::prepend(wchar_t const*) at workdir/UnpackedTarball/clucene/src/shared/CLucene/util/StringBuffer.cpp:214:7
>  #3 in lucene::analysis::standard::StandardTokenizer::ReadNumber(wchar_t const*, wchar_t, lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardTokenizer.cpp:181:11
>  #4 in lucene::analysis::standard::StandardTokenizer::ReadNumber(wchar_t const*, wchar_t, lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardTokenizer.cpp:238:16
>  #5 in lucene::analysis::standard::StandardTokenizer::next(lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardTokenizer.cpp:160:13
>  #6 in lucene::analysis::standard::StandardFilter::next(lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardFilter.cpp:27:16
>  #7 in lucene::analysis::LowerCaseFilter::next(lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/Analyzers.cpp:151:13
>  #8 in lucene::analysis::StopFilter::next(lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/Analyzers.cpp:218:16
>  #9 in lucene::index::DocumentsWriter::ThreadState::FieldData::invertField(lucene::document::Field*, lucene::analysis::Analyzer*, int) at workdir/UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriterThreadState.cpp:901:32
>  #10 in lucene::index::DocumentsWriter::ThreadState::FieldData::processField(lucene::analysis::Analyzer*) at workdir/UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriterThreadState.cpp:798:9
>  #11 in lucene::index::DocumentsWriter::ThreadState::processDocument(lucene::analysis::Analyzer*) at workdir/UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriterThreadState.cpp:557:24
>  #12 in lucene::index::DocumentsWriter::updateDocument(lucene::document::Document*, lucene::analysis::Analyzer*, lucene::index::Term*) at workdir/UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriter.cpp:946:16
>  #13 in lucene::index::DocumentsWriter::addDocument(lucene::document::Document*, lucene::analysis::Analyzer*) at workdir/UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriter.cpp:930:10
>  #14 in lucene::index::IndexWriter::addDocument(lucene::document::Document*, lucene::analysis::Analyzer*) at workdir/UnpackedTarball/clucene/src/core/CLucene/index/IndexWriter.cpp:685:28
>  #15 in HelpIndexer::indexDocuments() at helpcompiler/source/HelpIndexer.cxx:125:21
>  #16 in main at helpcompiler/source/HelpIndexer_main.cxx:79:22
>
> 0x7cacc15e1480 is located 0 bytes inside of 1024-byte region [0x7cacc15e1480,0x7cacc15e1880)
> allocated by thread T0 here:
>  #0 in malloc at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:67:3
>  #1 in lucene::analysis::Token::growBuffer(unsigned long) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/AnalysisHeader.cpp:162:21
>  #2 in lucene::analysis::standard::StandardTokenizer::ReadAlphaNum(wchar_t, lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardTokenizer.cpp:260:8
>  #3 in lucene::analysis::standard::StandardTokenizer::next(lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardTokenizer.cpp:154:13
>  #4 in lucene::analysis::standard::StandardFilter::next(lucene::analysis::Token*) at workdir/UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardFilter.cpp:27:16
>
> SUMMARY: AddressSanitizer: wcsncpy-param-overlap workdir/UnpackedTarball/clucene/src/shared/CLucene/util/StringBuffer.cpp:233:7 in lucene::util::StringBuffer::prepend(wchar_t const*, unsigned long)
> ==1084736==ABORTING
> make[1]: *** [nlpsolver/Extension_nlpsolver.mk:14: workdir/Extension/nlpsolver/root/help/de.done] Error 1

That wcsncpy move of a memory range onto itself looks a bit scary, but appears
to be by design of how recursive invocations of StandardTokenizer::ReadNumber
work.

Change-Id: I3ce9cc8343140ee287fac7db46b28e5adb7b67f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192069
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-08 16:57:48 +02:00
Stephan Bergmann 77c6878667 Avoid UBSan signed-integer-overflow
...by reverting the part of acf75a9b26 "Drop some
unnecessary explicit casts" that started to make CppunitTest_vcl_pdfexport2 fail
with

> /workdir/UnpackedTarball/boost/boost/rational.hpp:604:22: runtime error: signed integer overflow: 350932797 * 10 cannot be represented in type 'int'
>     #0 0x7f56315d94f1 in boost::rational<int>::operator/=(boost::rational<int> const&) /workdir/UnpackedTarball/boost/boost/rational.hpp:604:22
>     #1 0x7f56315d12dd in Fraction::operator/=(Fraction const&) /tools/source/generic/fract.cxx:239:7
>     #2 0x7f56315d40e8 in operator/(Fraction const&, Fraction const&) /tools/source/generic/fract.cxx:335:10
>     #3 0x7f5626bafc3f in vcl::PDFWriterImpl::drawLayout(SalLayout&, rtl::OUString const&, bool) /vcl/source/pdf/pdfwriter_impl.cxx:6767:69
>     #4 0x7f5626bcc194 in vcl::PDFWriterImpl::drawTextArray(Point const&, rtl::OUString const&, std::span<double const, 18446744073709551615ul>, std::span<unsigned char const, 18446744073709551615ul>, int, int, int, int) /vcl/source/pdf/pdfwriter_impl.cxx:7269:9
>     #5 0x7f5626a30fdd in vcl::PDFWriter::DrawTextArray(Point const&, rtl::OUString const&, std::span<double const, 18446744073709551615ul>, std::span<unsigned char const, 18446744073709551615ul>, int, int, int, int) /vcl/source/pdf/pdfwriter.cxx:87:22
>     #6 0x7f5626a58a6f in vcl::PDFWriterImpl::playMetafile(GDIMetaFile const&, vcl::PDFExtOutDevData*, vcl::PDFWriter::PlayMetafileContext const&, VirtualDevice*) /vcl/source/pdf/pdfwriter_impl2.cxx:821:34
>     #7 0x7f5626a3a9a5 in vcl::PDFWriter::PlayMetafile(GDIMetaFile const&, vcl::PDFWriter::PlayMetafileContext const&, vcl::PDFExtOutDevData*) /vcl/source/pdf/pdfwriter.cxx:474:22
>     #8 0x7f5599ef9e75 in PDFExport::ImplExportPage(vcl::PDFWriter&, vcl::PDFExtOutDevData&, GDIMetaFile const&) /filter/source/pdf/pdfexport.cxx:1333:13
>     #9 0x7f5599ef807c in PDFExport::ExportSelection(vcl::PDFWriter&, com::sun::star::uno::Reference<com::sun::star::view::XRenderable> const&, com::sun::star::uno::Any const&, StringRangeEnumerator const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&, int) /filter/source/pdf/pdfexport.cxx:212:25
>     #10 0x7f5599f11329 in PDFExport::Export(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /filter/source/pdf/pdfexport.cxx:1180:28
>     #11 0x7f5599f86342 in PDFFilter::implExport(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /filter/source/pdf/pdffilter.cxx:182:24
>     #12 0x7f5599f87093 in PDFFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /filter/source/pdf/pdffilter.cxx:247:23
>     #13 0x7f55df8d3f26 in SfxObjectShell::ExportTo(SfxMedium&) /sfx2/source/doc/objstor.cxx:2908:25
>     #14 0x7f55df8bf658 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) /sfx2/source/doc/objstor.cxx:1929:19
>     #15 0x7f55df8fbf63 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:3421:39
>     #16 0x7f55df8f383c in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:3212:9
>     #17 0x7f55df82ca66 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t> >, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objserv.cxx:323:19
>     #18 0x7f55dfb19501 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) /sfx2/source/doc/sfxbasemodel.cxx:3253:42
>     #19 0x7f55dfb20834 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1834:13
>     #20 0x7f5603982e5a in UnoApiTest::saveWithParams(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:194:16
>     #21 0x7f5604ee9776 in (anonymous namespace)::PdfExportTest2::saveAsPDF(std::basic_string_view<char16_t, std::char_traits<char16_t> >) /vcl/qa/cppunit/pdfexport/pdfexport2.cxx:76:5
>     #22 0x7f560518fa16 in (anonymous namespace)::testTdf145873::TestBody() /vcl/qa/cppunit/pdfexport/pdfexport2.cxx:4171:5

(<https://ci.libreoffice.org/job/lo_ubsan/3685/>)

Change-Id: I607d1b66bdae9cece0102a99ef817864b3d27877
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191928
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-10-06 08:26:12 +02:00