diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-22 12:26:48 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-23 10:40:54 +0200 |
commit | 694db7d3e7be0caf81dd52dba1a865db206ac145 (patch) | |
tree | d1b9512123766164ce7c744fcc4428e7f3745463 | |
parent | 5d02daa5198d5bff9234d5db698e934a5e31c95f (diff) |
svl: spurious GCC12 -Werror=maybe-uninitialized
In file included from svl/source/misc/sharedstringpool.cxx:11:
In constructor ‘svl::SharedString::SharedString(rtl_uString*, rtl_uString*)’,
inlined from ‘svl::SharedString svl::SharedStringPool::intern(const rtl::OUString&)’ at svl/source/misc/sharedstringpool.cxx:129:51:
include/svl/sharedstring.hxx:56:20: error: ‘pResultUpper’ may be used uninitialized [-Werror=maybe-uninitialized]
56 | mpData(pData), mpDataIgnoreCase(pDataIgnoreCase)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svl/source/misc/sharedstringpool.cxx: In member function ‘svl::SharedString svl::SharedStringPool::intern(const rtl::OUString&)’:
svl/source/misc/sharedstringpool.cxx:93:33: note: ‘pResultUpper’ was declared here
93 | rtl_uString *pResultLower, *pResultUpper;
| ^~~~~~~~~~~~
Change-Id: I2171855844c76ad3b2a72c1eca737691ca96fc46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134736
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | svl/source/misc/sharedstringpool.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/svl/source/misc/sharedstringpool.cxx b/svl/source/misc/sharedstringpool.cxx index a37c36b641d7..4f891d3677d1 100644 --- a/svl/source/misc/sharedstringpool.cxx +++ b/svl/source/misc/sharedstringpool.cxx @@ -90,7 +90,7 @@ SharedString SharedStringPool::intern(const OUString& rStr) { auto& rMap = mpImpl->maStrMap; - rtl_uString *pResultLower, *pResultUpper; + rtl_uString *pResultLower = {}, *pResultUpper = {}; // bogus GCC 12 -Werror=maybe-uninitialized if (rMap.find_fn(rStr.pData, [&](const Mapped& rMapped) { pResultLower = rMapped.first.pData; pResultUpper = rMapped.second.pData; |