diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2022-12-11 15:21:40 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2022-12-13 14:41:29 +0200 |
commit | 419c99f83511e80cffed899a6e6f424280c471f6 (patch) | |
tree | 08d5ca1f34edffb3ff0490885686ccaece384ba8 | |
parent | e3ae2a505e123ee22de0fe6e5f4aff74ee1bb933 (diff) |
QByteArrayApiSymmetry: silence two clang warnings
tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp:1174:80:
warning: overflow in expression; result is -9223372036854775808 with
type 'long long' [-Winteger-overflow]
const qlonglong longMaxPlusOne =
static_cast<qlonglong>(Bounds::max()) + 1;
tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp:1175:81:
warning: overflow in expression; result is 9223372036854775807 with type
'long long' [-Winteger-overflow]
const qlonglong longMinMinusOne =
static_cast<qlonglong>(Bounds::min()) - 1;
I usually build with GCC, but building with Clang for clazy-standalone,
so I saw these two warnings 500+ times, enough already. :)
Change-Id: Idd86af568ffe89ae49b2a3f9bbeedf312de5e631
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp b/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp index 514314d0f3..21c35d7b48 100644 --- a/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp +++ b/tests/auto/corelib/text/qbytearrayapisymmetry/tst_qbytearrayapisymmetry.cpp @@ -1171,8 +1171,13 @@ void tst_QByteArrayApiSymmetry::toLong_data() const QTest::newRow("int32 max dec") << QByteArray("2147483647") << 10 << long(B32::max()) << true; if constexpr (sizeof(long) < sizeof(qlonglong)) { + QT_WARNING_PUSH + // See: https://github.com/llvm/llvm-project/issues/59448 + QT_WARNING_DISABLE_CLANG("-Winteger-overflow") const qlonglong longMaxPlusOne = static_cast<qlonglong>(Bounds::max()) + 1; const qlonglong longMinMinusOne = static_cast<qlonglong>(Bounds::min()) - 1; + QT_WARNING_POP + QTest::newRow("long max + 1") << QByteArray::number(longMaxPlusOne) << 10 << 0L << false; QTest::newRow("long min - 1") << QByteArray::number(longMinMinusOne) << 10 << 0L << false; } |