diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-05-22 12:51:35 +0200 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-06-07 17:34:09 +0200 |
commit | 0a49da180c1e071360bb1b5bf664cb6264173885 (patch) | |
tree | 9b0765198259e38e7509fa91f9629e0849c7567d | |
parent | ed3d572b730d1873dd66fa2a31695248d506a335 (diff) |
vcl: WhitespaceToSpace() spurious -Werror=maybe-uninitialized
vcl/source/helper/strhelper.cxx:366:9: error: ‘pBuffer[-1]’ may be used uninitialized [-Werror=maybe-uninitialized]
Change-Id: I37250b0790bd9c33eb01c552c8267251bc0026f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134738
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit cd4976646dc2e5b28c3328a7fa96361e147b23b9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134631
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r-- | vcl/source/helper/strhelper.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index 782c9ce123e1..81648d9a7a43 100644 --- a/vcl/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -360,9 +360,15 @@ OString WhitespaceToSpace(const OString& rLine) // there might be a space at beginning or end pLeap--; +#if defined(__GNUC__) && __GNUC__ == 12 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif if( *pLeap == ' ' ) *pLeap = 0; - +#if defined(__GNUC__) && __GNUC__ == 12 +#pragma GCC diagnostic pop +#endif return *pBuffer == ' ' ? pBuffer+1 : pBuffer; } |