diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-15 22:39:41 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-16 20:24:32 +0200 |
commit | 395fa85403d1b7fc01e66d9faa015691e133e213 (patch) | |
tree | c7509154c008399de49c59f8574ca5b67a4264d2 /src/corelib/global | |
parent | 3df3bdcdb3b797a655ae28900111343b67da99d7 (diff) |
Add central macro to disable float comparison warnings
QParsedNumber will need it, as do some others, like QAngle.
Change-Id: Iee09f498d2cdbb28d43b94301328ec7858661ad2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 075d7c5c65..7b86279670 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1247,6 +1247,7 @@ # define QT_WARNING_DISABLE_CLANG(text) # define QT_WARNING_DISABLE_GCC(text) # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1478 1786) +# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_INTEL(1572) #elif defined(Q_CC_INTEL) /* icc: Intel compiler on Linux or OS X */ # define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push)) @@ -1256,6 +1257,7 @@ # define QT_WARNING_DISABLE_CLANG(text) # define QT_WARNING_DISABLE_GCC(text) # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1478 1786) +# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_INTEL(1572) #elif defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) # undef QT_DO_PRAGMA /* not needed */ # define QT_WARNING_PUSH __pragma(warning(push)) @@ -1265,6 +1267,7 @@ # define QT_WARNING_DISABLE_CLANG(text) # define QT_WARNING_DISABLE_GCC(text) # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996) +# define QT_WARNING_DISABLE_FLOAT_COMPARE #elif defined(Q_CC_CLANG) # define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push) # define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop) @@ -1273,6 +1276,7 @@ # define QT_WARNING_DISABLE_INTEL(number) # define QT_WARNING_DISABLE_MSVC(number) # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations") +# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_CLANG("-Wfloat-equal") #elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) # define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push) # define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop) @@ -1281,6 +1285,7 @@ # define QT_WARNING_DISABLE_INTEL(number) # define QT_WARNING_DISABLE_MSVC(number) # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations") +# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal") #else // All other compilers, GCC < 4.6 and MSVC < 2008 # define QT_WARNING_DISABLE_GCC(text) # define QT_WARNING_PUSH @@ -1290,6 +1295,7 @@ # define QT_WARNING_DISABLE_CLANG(text) # define QT_WARNING_DISABLE_GCC(text) # define QT_WARNING_DISABLE_DEPRECATED +# define QT_WARNING_DISABLE_FLOAT_COMPARE #endif #ifndef QT_IGNORE_DEPRECATIONS |