diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-04-22 10:15:02 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2022-04-25 15:05:25 +0200 |
commit | b3651868609cc1d4b9316d8ec65a0656b421970e (patch) | |
tree | 20b5ec2ba9e4dc19d7e001678ece7399a47c7792 /src/corelib/text/qlocale.cpp | |
parent | 242633430ba22d8f4d390067d4a68a4f54826af2 (diff) |
Fix unused variables in qtbase
clang compiler recently got smarter and detects "pseudo used variable"
patterns where we declare a variable and only use it in self-increments,
self-decrements and other similar expressions
Errors:
qtbase/src/corelib/text/qlocale.cpp:3898:9: error: variable 'group_cnt' set but not used [-Werror,-Wunused-but-set-variable]
int group_cnt = 0; // counts number of group chars
^
qtbase/src/corelib/text/qunicodetools.cpp:1372:21: error: variable 'uc' set but not used [-Werror,-Wunused-but-set-variable]
const char16_t *uc = text + from;
^
and more of the kind
Remove the ones that have no usage, mark others with [[maybe_unused]]
Pick-to: 6.3 6.2
Change-Id: Ib2d0722110e3da8c39e29ec78c0ec290d064c970
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r-- | src/corelib/text/qlocale.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index bdd896b4c8..8a272c6e49 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -3904,7 +3904,6 @@ bool QLocaleData::numberToCLocale(QStringView s, QLocale::NumberOptions number_o decltype(length) idx = 0; int digitsInGroup = 0; - int group_cnt = 0; // counts number of group chars int decpt_idx = -1; int last_separator_idx = -1; int start_of_digits_idx = -1; @@ -3974,7 +3973,6 @@ bool QLocaleData::numberToCLocale(QStringView s, QLocale::NumberOptions number_o } last_separator_idx = idx; - ++group_cnt; digitsInGroup = 0; // don't add the group separator |