summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-04-25 14:00:58 -0700
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-05-11 21:56:53 +0000
commit0705491e7f36236444c592a895849e4eb17323f9 (patch)
tree49b60f93762109e7eabeda20ae4e0d266f390210 /src/gui/text
parent0be89fb8e1f3787017ffc30bab69dd2b72bf970e (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. Change-Id: I7fb65b80b7844c8d8f26fffd16e93f68e278d048 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 5302857f5a716037aaef22143ea11102ad47bce0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextengine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index d32b3d7ecb..6c0628796e 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2282,6 +2282,12 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix
if (feCache.prevScaledFontEngine) {
scaledEngine = feCache.prevScaledFontEngine;
} else {
+ // GCC 12 gets confused about QFontEngine::ref, 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_PUSH
+ QT_WARNING_DISABLE_GCC("-Wstringop-overflow")
+
QFontEngine *scEngine = rawFont.d->fontEngine->cloneWithSize(smallCapsFraction * rawFont.pixelSize());
scEngine->ref.ref();
scaledEngine = QFontEngineMulti::createMultiFontEngine(scEngine, script);
@@ -2291,6 +2297,7 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix
if (!scEngine->ref.deref())
delete scEngine;
+ QT_WARNING_POP
}
}
} else