From beabc635987e4775c8e7c2e4f25ac9d61be1d8f9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 17 Jun 2024 06:29:04 +0200 Subject: [PATCH] tst_QGlobal: fix -Wmaybe-uninitialized GCC 14 doesn't understand that neither q_check_ptr() nor qCompare dereference the pointer. Since the missing initialization isn't part of the test (except, maybe, to provoke this warning if the implementation indeed changed to dereference the pointer), fix by initializing the int, like we do for the string a few lines below. Amends the start of the public history. Pick-to: 6.7 6.5 6.2 5.15 Change-Id: I6033e026f041b03821b776daa8e65586b8054136 Reviewed-by: Thiago Macieira (cherry picked from commit 8e914e07fbac8b40e51d0e6da764fa13a6af8181) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/corelib/global/qglobal/tst_qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index 1a19048bbe7..3fc91e4f594 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -261,7 +261,7 @@ void tst_QGlobal::qtry() void tst_QGlobal::checkptr() { - int i; + int i = 0; QCOMPARE(q_check_ptr(&i), &i); const char *c = "hello";