diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-31 21:26:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-06-01 10:06:56 +0200 |
commit | 36ec021c6eafe80caefbedbbe674bd1ee0a9429a (patch) | |
tree | 2cf1e878f6bb5bb1a75665715a7a0695dbee47bb /vcl/source/helper | |
parent | a5c1b749a89b662f9a136d774b3dfd5fbd639c50 (diff) |
WaE: WhitespaceToSpace() spurious -Werror=maybe-uninitialized
vcl/source/helper/strhelper.cxx:366:9: error: ‘pBuffer[-1]’ may be used uninitialized [-Werror=maybe-uninitialized]
I see this with gcc 13 too
Change-Id: I3ddc5fadb9177827e6cd49f5b6366a79204e95c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152469
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl/source/helper')
-rw-r--r-- | vcl/source/helper/strhelper.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index 9d05b2c9811e..ebe48d1200ef 100644 --- a/vcl/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -363,13 +363,13 @@ OString WhitespaceToSpace(std::string_view rLine) // there might be a space at beginning or end assert(pLeap > pBuffer); pLeap--; -#if defined(__GNUC__) && __GNUC__ == 12 +#if defined(__GNUC__) && (__GNUC__ == 12 || __GNUC__ == 13) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif if( *pLeap == ' ' ) *pLeap = 0; -#if defined(__GNUC__) && __GNUC__ == 12 +#if defined(__GNUC__) && (__GNUC__ == 12 || __GNUC__ == 13) #pragma GCC diagnostic pop #endif return *pBuffer == ' ' ? pBuffer+1 : pBuffer; |