RESOLVED FIXED305348
[TestWebKitAPI][GLib] g_assert_cmpstr: warning: temporary whose address is used as value of local variable '__s2' will be destroyed at the end of the full-expression [-Wdangling]
https://bugs.webkit.org/show_bug.cgi?id=305348
Summary [TestWebKitAPI][GLib] g_assert_cmpstr: warning: temporary whose address is u...
Fujii Hironori
Reported 2026-01-12 16:07:10 PST
Clang reports the following warnings for compiling WebKit. [9780/9986] Building CXX object Tools/TestWebKitAPI/glib/CMakeFiles/TestWebKitPolicyClient.dir/__/Tests/WebKitGLib/TestWebKitPolicyClient.cpp.o ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp:195:62: warning: temporary whose address is used as value of local variable '__s2' will be destroyed at the end of the full-expression [-Wdangling] 195 | g_assert_cmpstr(webkit_uri_request_get_uri(request), ==, kServer->getURIForPath("/").data()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:80: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ 1 warning generated. [9798/9986] Building CXX object Tools/TestWebKitAPI/glib/CMakeFiles/TestWebKitWebXR.dir/__/Tests/WebKitGLib/TestWebKitWebXR.cpp.o ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebXR.cpp:227:21: warning: temporary whose address is used as value of local variable '__s1' will be destroyed at the end of the full-expression [-Wdangling] 227 | g_assert_cmpstr(data.result.title.utf8().data(), ==, "fail"); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:66: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebXR.cpp:235:21: warning: temporary whose address is used as value of local variable '__s1' will be destroyed at the end of the full-expression [-Wdangling] 235 | g_assert_cmpstr(data.result.title.utf8().data(), ==, "pass"); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:66: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebXR.cpp:240:21: warning: temporary whose address is used as value of local variable '__s1' will be destroyed at the end of the full-expression [-Wdangling] 240 | g_assert_cmpstr(data.result.origin.utf8().data(), ==, "https://foo.com"); | ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:66: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebXR.cpp:246:21: warning: temporary whose address is used as value of local variable '__s1' will be destroyed at the end of the full-expression [-Wdangling] 246 | g_assert_cmpstr(data.result.title.utf8().data(), ==, "fail"); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:66: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebXR.cpp:252:21: warning: temporary whose address is used as value of local variable '__s1' will be destroyed at the end of the full-expression [-Wdangling] 252 | g_assert_cmpstr(data.result.origin.utf8().data(), ==, "https://foo.com"); | ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:66: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebXR.cpp:258:21: warning: temporary whose address is used as value of local variable '__s1' will be destroyed at the end of the full-expression [-Wdangling] 258 | g_assert_cmpstr(data.result.title.utf8().data(), ==, "pass"); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:66: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebXR.cpp:309:21: warning: temporary whose address is used as value of local variable '__s1' will be destroyed at the end of the full-expression [-Wdangling] 309 | g_assert_cmpstr(testHitTest().utf8().data(), ==, "NotSupportedError: The operation is not supported."); | ^~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:66: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ 7 warnings generated. [9815/9986] Building CXX object Tools/TestWebKitAPI/glib/CMakeFiles/TestAutomationSession.dir/__/Tests/WebKitGLib/TestAutomationSession.cpp.o ../../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:327:68: warning: temporary whose address is used as value of local variable '__s2' will be destroyed at the end of the full-expression [-Wdangling] 327 | g_assert_cmpstr(webkit_automation_session_get_id(session), ==, sessionID.utf8().data()); | ^~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gtestutils.h:47:80: note: expanded from macro 'g_assert_cmpstr' 47 | const char *__s1 = (s1), *__s2 = (s2); \ | ^~ 1 warning generated. [9986/9986] Linking CXX executable bin/WebKitTestRunner
Attachments
Fujii Hironori
Comment 1 2026-01-13 00:08:04 PST
EWS
Comment 2 2026-01-13 01:19:47 PST
Committed 305503@main (a3aa44e96f03): <https://commits.webkit.org/305503@main> Reviewed commits have been landed. Closing PR #56479 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.