RESOLVED FIXED312457
[WTF][GLib] Clang 22 produces -Wunsafe-buffer-usage-in-format-attr-call warning spam in journald logging code
https://bugs.webkit.org/show_bug.cgi?id=312457
Summary [WTF][GLib] Clang 22 produces -Wunsafe-buffer-usage-in-format-attr-call warni...
Adrian Perez
Reported 2026-04-16 02:02:48 PDT
There are many instances of: ../Source/WTF/wtf/glib/SocketConnection.cpp:67:5: warning: formatting function 'wtfCompileTimeCheckPrintfSpecifier' is unsafe [-Wunsafe-buffer-usage-in-format-attr-call] 67 | RELEASE_LOG_FAULT_WITH_PAYLOAD(Process, makeString("Received invalid message ("_s, message.span(), "), closing SocketConnection"_s).utf8().data()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/Assertions.h:797:58: note: expanded from macro 'RELEASE_LOG_FAULT_WITH_PAYLOAD' 797 | #define RELEASE_LOG_FAULT_WITH_PAYLOAD(channel, message) SD_JOURNAL_SEND(channel, LOG_CRIT, __FILE__, _STRINGIFY(__LINE__), __func__, "%s", message) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/Assertions.h:789:5: note: expanded from macro 'SD_JOURNAL_SEND' 789 | wtfCompileTimeCheckPrintfSpecifier(__VA_ARGS__); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../Source/WTF/wtf/glib/SocketConnection.cpp:67:45: note: string argument is not guaranteed to be null-terminated 67 | RELEASE_LOG_FAULT_WITH_PAYLOAD(Process, makeString("Received invalid message ("_s, message.span(), "), closing SocketConnection"_s).utf8().data()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Attachments
Adrian Perez
Comment 1 2026-04-16 02:09:51 PDT
EWS
Comment 2 2026-04-16 05:42:04 PDT
Committed 311363@main (427b518060e9): <https://commits.webkit.org/311363@main> Reviewed commits have been landed. Closing PR #62889 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2026-04-16 05:43:13 PDT
Note You need to log in before you can comment on or make changes to this bug.