RESOLVED FIXED312303
[WTF][GLib] Building with Clang 22 produces -Wunsafe-buffer-usage-in-format-attr-call warning spam in sysprof code
https://bugs.webkit.org/show_bug.cgi?id=312303
Summary [WTF][GLib] Building with Clang 22 produces -Wunsafe-buffer-usage-in-format-a...
Adrian Perez
Reported 2026-04-14 12:45:54 PDT
../Source/WTF/wtf/glib/SysprofAnnotator.h:56:9: warning: formatting function 'sysprof_collector_mark_vprintf' is unsafe [-Wunsafe-buffer-usage-in-format-attr-call] 56 | sysprof_collector_mark_vprintf(SYSPROF_CAPTURE_CURRENT_TIME, 0, m_processName, name.data(), description, args); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/glib/SysprofAnnotator.h:56:101: note: string argument is not guaranteed to be null-terminated 56 | sysprof_collector_mark_vprintf(SYSPROF_CAPTURE_CURRENT_TIME, 0, m_processName, name.data(), description, args); | ^~~~~~~~~~~ ../Source/WTF/wtf/glib/SysprofAnnotator.h:64:9: warning: formatting function 'sysprof_collector_mark_vprintf' is unsafe [-Wunsafe-buffer-usage-in-format-attr-call] 64 | sysprof_collector_mark_vprintf(time, 0, m_processName, name.data(), description, args); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/glib/SysprofAnnotator.h:64:77: note: string argument is not guaranteed to be null-terminated 64 | sysprof_collector_mark_vprintf(time, 0, m_processName, name.data(), description, args); | ^~~~~~~~~~~ ../Source/WTF/wtf/glib/SysprofAnnotator.h:146:13: warning: formatting function 'sysprof_collector_mark_vprintf' is unsafe [-Wunsafe-buffer-usage-in-format-attr-call] 146 | sysprof_collector_mark_vprintf(time, 0, m_processName, name.data(), description, args); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/glib/SysprofAnnotator.h:146:81: note: string argument is not guaranteed to be null-terminated 146 | sysprof_collector_mark_vprintf(time, 0, m_processName, name.data(), description, args); | ^~~~~~~~~~~ ../Source/WTF/wtf/glib/RunLoopGLib.cpp:108:13: warning: formatting function 'instantMark' is unsafe [-Wunsafe-buffer-usage-in-format-attr-call] 108 | WTFEmitSignpost(source, RunLoopSourceDispatch, "[%s] lateness=%" G_GINT64_FORMAT "µs", g_source_get_name(source), lateness); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/SystemTracing.h:425:13: note: expanded from macro 'WTFEmitSignpost' 425 | annotator->instantMark(std::span(_STRINGIFY(name)), "" __VA_ARGS__); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/glib/RunLoopGLib.cpp:108:101: note: string argument is not guaranteed to be null-terminated 108 | WTFEmitSignpost(source, RunLoopSourceDispatch, "[%s] lateness=%" G_GINT64_FORMAT "µs", g_source_get_name(source), lateness); | ^~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/SystemTracing.h:425:68: note: expanded from macro 'WTFEmitSignpost' 425 | annotator->instantMark(std::span(_STRINGIFY(name)), "" __VA_ARGS__); \ | ^~~~~~~~~~~
Attachments
Adrian Perez
Comment 1 2026-04-14 13:57:09 PDT
EWS
Comment 2 2026-04-15 00:22:19 PDT
Committed 311265@main (24453f37f659): <https://commits.webkit.org/311265@main> Reviewed commits have been landed. Closing PR #62764 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2026-04-15 00:23:13 PDT
Note You need to log in before you can comment on or make changes to this bug.