diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2022-04-25 14:00:58 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-11 12:50:08 -0700 |
| commit | 5302857f5a716037aaef22143ea11102ad47bce0 (patch) | |
| tree | 77d10d92418bba632637feb9961bb365bc3b1a3b /src/corelib/thread/qfutureinterface.cpp | |
| parent | 2984fcbb3df73646a26659f0b947aff5774208f4 (diff) | |
Atomics: workaround GCC 12 warning about overflowing d->state
I don't see a way this can be anything but a bogus warning.
In member function ‘std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::fetch_or(__int_type, std::memory_order) [with _ITp = int]’,
inlined from ‘static T QAtomicOps<X>::fetchAndOrRelaxed(std::atomic<T>&, typename QAtomicAdditiveType<T>::AdditiveT) [with T = int; X = int]’ at qatomic_cxx11.h:449:33,
inlined from ‘T QBasicAtomicInteger<T>::fetchAndOrRelaxed(T) [with T = int]’ at qbasicatomic.h:168:36,
inlined from ‘int switch_on(QAtomicInt&, int)’ at qfutureinterface.cpp:97:31,
inlined from ‘void QFutureInterfaceBase::setThrottled(bool)’ at qfutureinterface.cpp:194:18:
atomic_base.h:648:33: warning: ‘unsigned int __atomic_or_fetch_4(volatile void*, unsigned int, int)’ writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
A few more of those appear in other modules. I'm not fixing them all,
assuming GCC will soon fix the warning.
Pick-to: 6.2 6.3
Change-Id: I7fb65b80b7844c8d8f26fffd16e93f68e278d048
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/thread/qfutureinterface.cpp')
| -rw-r--r-- | src/corelib/thread/qfutureinterface.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp index efbcf9ce583..84d6b09ce8d 100644 --- a/src/corelib/thread/qfutureinterface.cpp +++ b/src/corelib/thread/qfutureinterface.cpp @@ -50,6 +50,11 @@ # undef interface #endif +// GCC 12 gets confused about QFutureInterfaceBase::state, for some non-obvious +// reason +// warning: ‘unsigned int __atomic_or_fetch_4(volatile void*, unsigned int, int)’ writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] +QT_WARNING_DISABLE_GCC("-Wstringop-overflow") + QT_BEGIN_NAMESPACE enum { |
