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 { diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index c7e5c19c31f..37388750ff0 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2277,6 +2277,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); @@ -2286,6 +2292,7 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix if (!scEngine->ref.deref()) delete scEngine; + QT_WARNING_POP } } } else