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/network/access | |
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/network/access')
-rw-r--r-- | src/network/access/qnetworkdiskcache.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 069267e543..dff16adde7 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -536,7 +536,7 @@ qint64 QNetworkDiskCache::expire() } } - int removedFiles = 0; + [[maybe_unused]] int removedFiles = 0; // used under QNETWORKDISKCACHE_DEBUG qint64 goal = (maximumCacheSize() * 9) / 10; QMultiMap<QDateTime, QString>::const_iterator i = cacheItems.constBegin(); while (i != cacheItems.constEnd()) { |