Files
core/idl/source
Stephan Bergmann 5add8fd404 Silence bogus GCC -Wmaybe-uninitialized
> In file included from idl/source/cmptools/lex.cxx:22:
> In member function ‘SvToken& SvToken::operator=(const SvToken&)’,
>     inlined from ‘void SvTokenStream::FillTokenList()’ at idl/source/cmptools/lex.cxx:92:35:
> idl/inc/lex.hxx:35:7: error: ‘<anonymous>.SvToken::<anonymous>’ may be used uninitialized [-Werror=maybe-uninitialized]
>    35 | class SvToken
>       |       ^~~~~~~
> idl/source/cmptools/lex.cxx: In member function ‘void SvTokenStream::FillTokenList()’:
> idl/source/cmptools/lex.cxx:92:35: note: ‘<anonymous>’ declared here
>    92 |                 *pToken = SvToken();
>       |                                   ^
> In member function ‘SvToken& SvToken::operator=(const SvToken&)’,
>     inlined from ‘void SvTokenStream::FillTokenList()’ at idl/source/cmptools/lex.cxx:101:31:
> idl/inc/lex.hxx:35:7: error: ‘<anonymous>.SvToken::<anonymous>’ may be used uninitialized [-Werror=maybe-uninitialized]
>    35 | class SvToken
>       |       ^~~~~~~
> idl/source/cmptools/lex.cxx: In member function ‘void SvTokenStream::FillTokenList()’:
> idl/source/cmptools/lex.cxx:101:31: note: ‘<anonymous>’ declared here
>   101 |             *pToken = SvToken();
>       |                               ^

seen in optimizing LO builds using at least GCC 12
(<https://ci.libreoffice.org/job/gerrit_linux_gcc_release/192633/>) and GCC 15
(locally, gcc-15.1.1-2.fc42.x86_64) after upcoming
<https://gerrit.libreoffice.org/c/core/+/188236> "Make O[U]String default ctors
constexpr".

(And without adding the additional braces in the second code block, at least GCC
15 would emit an odd

> idl/source/cmptools/lex.cxx: In member function ‘void SvTokenStream::FillTokenList()’:
> idl/source/cmptools/lex.cxx:116:9: error: ‘else’ without a previous ‘if’
>   116 |         else if( pToken->IsEof() )
>       |         ^~~~

)

Change-Id: I171c746ea3f6035bc737b4bcd636dd063dd9186e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188265
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-07-24 17:13:29 +02:00
..
2025-07-12 19:49:42 +02:00