QTest::toString(): Fix format specifier for q(u)int64 on Windows

Qt 5 had qint64 as __int64 on Windows, so using I64 was correct, then,
but MinGW was already using long long, so using I64 for all Q_OS_WIN
builds was wrong even then. So exclude Q_CC_GNU from the I64
formatting.

In Qt 6, all platforms always use long long, so no Windows-specific
handling is needed anymore.

Found by adding __attribute__((format(printf))) to qsnprintf().

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Icfa0afc6f0fe06e5d47684702097ac1d3da6cef1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ab74c1779ec2499758449d41999356a91bb82cf8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-07-31 09:02:44 +02:00 committed by Qt Cherry-pick Bot
parent 821a8fd523
commit d7a8b34d4a

View File

@ -3005,7 +3005,7 @@ TO_STRING_IMPL(int, %d)
TO_STRING_IMPL(uint, %u)
TO_STRING_IMPL(long, %ld)
TO_STRING_IMPL(ulong, %lu)
#if defined(Q_OS_WIN)
#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
TO_STRING_IMPL(qint64, %I64d)
TO_STRING_IMPL(quint64, %I64u)
#else