summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qhash.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-02 12:54:23 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-05-06 09:52:46 +0200
commitcdd4a953171d1d4d897b3affd2fd944fcff37f68 (patch)
tree847acf97999a3ec4878b85403063e52ce71c60ce /src/corelib/tools/qhash.cpp
parent5b246e15f1231f2b9c396fd067c76230dcea5d15 (diff)
Use Q_CC_{GNU,MSVC}_ONLY when comparing to particular versions
This prevents false-negatives and false-positives, as e.g. Clang 10.0.0 masks as GCC 4.2, so Q_CC_GNU is 402 on that compiler. Depending on the test (Q_CC_GNU > NNN or Q_CC_GNU < NNN), the result of the test is almost random. Q_CC_<comp>_ONLY makes sure we match only GCC or MSVC, not bycatch such as Clang or ICC. Pick-to: 6.3 6.2 5.15 Change-Id: I4c550a11ecf85fc9a2216b330b69bd03d45b47e0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/tools/qhash.cpp')
-rw-r--r--src/corelib/tools/qhash.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 24e710c2e5..8c1c3a8d13 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -382,7 +382,7 @@ static uint64_t siphash(const uint8_t *in, uint64_t inlen, uint64_t seed, uint64
}
-#if defined(Q_CC_GNU) && Q_CC_GNU >= 700
+#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 700
QT_WARNING_DISABLE_GCC("-Wimplicit-fallthrough")
#endif
switch (left) {
@@ -486,7 +486,7 @@ static uint siphash(const uint8_t *in, uint inlen, uint seed, uint seed2)
v0 ^= m;
}
-#if defined(Q_CC_GNU) && Q_CC_GNU >= 700
+#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 700
QT_WARNING_DISABLE_GCC("-Wimplicit-fallthrough")
#endif
switch (left) {